AttributeError: module 'tensorflow.tools.api.generator.api.train' has no attribute 'SummaryWriter'

AttributeError: module 'tensorflow.tools.api.generator.api.train' has no attribute 'SummaryWriter'

 

 summary_writer = tf.train.SummaryWriter('/tmp/lstm_logs',session.graph)

改为:

summary_writer = tf.summary.FileWriter('/tmp/lstm_logs',session.graph)

 

 

tensorflow.initialize_all_variables已改为tensorflow.global_variables_initializer()

AttributeError: module ‘tensorflow.python.training.training’ has no attribute ‘SummaryWriter’

tf.train.SummaryWriter已废除
使用 tf.summary.FileWriter

AttributeError: module ‘tensorflow’ has no attribute ‘sub’

减法 tf.sub() 已改为tf.subtract()
---------------------  

AttributeError: 'module' object has no attribute 'SummaryWriter'

tf.train.SummaryWriter

改为:tf.summary.FileWriter


AttributeError: 'module' object has no attribute 'summaries'

tf.merge_all_summaries()

改为:summary_op = tf.summary.merge_all()


AttributeError: 'module' object has no attribute 'histogram_summary'

tf.histogram_summary()

改为:tf.summary.histogram()


tf.scalar_summary()

改为:tf.summary.scalar()


tf.image_summary()

改为:tf.summary.image()
---------------------  
作者:激进的小鸡蛋  
来源:CSDN  
原文:https://blog.csdn.net/waterydd/article/details/70237984  
版权声明:本文为博主原创文章,转载请附上博文链接!

 

执行如下操作(对应文件夹目录下)

tensorboard --logdir='logs/'
/home/gden/anaconda3/lib/python3.6/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters
TensorBoard 1.11.0 at http://gden-dl:6006 (Press CTRL+C to quit)

复制地址到浏览器就可以执行了

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值