使用tensorFlow完成对MNIST数据集的训练

参考tensorflow官方文档中文版

希望使用TensorBoard实现可视化,但是这个官方文档可能很久没更新了,很多函数已经用不了了。

merged_summary_op = tf.merge_all_summaries()
报错:

    merged_summary_op = tf.merge_all_summaries()
AttributeError: module 'tensorflow' has no attribute 'merge_all_summaries'
 改为: 
  
merged_summary_op = tf.summary.merge_all()


summary_writer = tf.train.SummaryWriter('/mnist_logs', sess.graph)
报错:

    summary_writer = tf.train.SummaryWriter('/mnist_logs', sess.graph)
AttributeError: module 'tensorflow.python.training.training' has no attribute 'SummaryWriter'

改为:

summary_writer = tf.summary.FileWriter('/mnist_logs', sess.graph)


pycharm中打开命令行输入:

tensorboard --logdir='/mnist_logs'

显示

TensorBoard 0.4.0rc3 at http://ting-pc:6006 (Press CTRL+C to quit)

打开浏览器,地址栏输入:http://ting-pc:6006就可以看到

tensorboard的页面了

你可能感兴趣的:(error)