问题如题,在运用Tensorboard进行可视化时,报错:AttributeError: module 'tensorflow' has no attribute 'flags'
tf.flags.DEFINE_integer(
AttributeError: module 'tensorflow' has no attribute 'flags'
解决办法:同步tensorboard版本与tensorflow版本保持一致。
做法:
1. 查看版本
pip list
2. 对比tensorboard版本与tensorflow版本是否一致
tensorboard 2.2
tensorflow 2.11.0
3. 如果不一致,如上图所示,先卸载tensorboard
pip uninstall tensorboard
4. 再安装与tensorflow版本一致的tensorboard
pip install tensorboard==2.11.0
5. 安装完成后测试即可
tensorboard --logdir runs
Serving TensorBoard on localhost; to expose to the network, use a proxy or pass --bind_all
TensorBoard 2.11.0 at http://localhost:6006/ (Press CTRL+C to quit)
问题解决!