为了实现tensorflow可视化,我使用tf.summary.FileWriter()的时候,
会出现错误提示:AttributeError: module 'tensor board.summary._tf.summary' has no attribute 'FileWriter'
我发现这个问题网上没有博客提到这个问题,所以就把我的解决过程记录如下。
1.将原来使用的tf.summary.FileWriter()换成tf.train.SummaryWriter()
报错:AttributeError: module 'tensorflow._api.v2.train' has no attribute 'SummaryWriter'
2.安装更老版本的tensorboard
输入:sudo pip install 'tensorboard==1.6.0'
报错:AttributeError: module 'tensorflow._api.v2.train' has no attribute 'FileWriter'
3.最后发现tensorflow版本的问题
将tf.summary.FileWriter()换成tf.summary.create_file_writer(),解决问题!