tensorflow出现如下错误:AttributeError: ‘module’ object has no attribute ‘merge_all_summaries’

tensorflow版本问题,导致函数的变化,summary使用如下变化机制:

AttributeError: ‘module’ object has no attribute ‘merge_all_summaries’ 

merged_summary_op = tf.merge_all_summaries()  ====》修改为merged_summary_op = tf.summary.merge_all()

 

AttributeError: ‘module’ object has no attribute ‘scalar_summary’ 


tf.scalar_summary("accuracy", accuracy)====》修改为 tf.summary.scalar("accuracy", accuracy)

summary_writer = tf.train.SummaryWriter('/tmp/logs', graph_def=sess.graph_def)     

==》修改为 summary_writer = tf.summary.FileWriter('/tmp/logs', graph_def=sess.graph_def)

 

启动tensorboard的命令,~ tensorboard --logdir=/tmp/logs

 

你可能感兴趣的:(深度学习,python,tensorflow)