今天在学习tensorboard时,运行代码出现了下面报错:AttributeError: module 'tensorflow' has no attribute 'io'

 修改步骤:

1.根据报错信息的提示,点击event_file_writer.py这个文件

 2.进入到event_file_writer.py这个文件,找到该文件的包的导入

from tensorboard.compat import tf

 修改为:

from tensorboard.compat import tensorflow_stub as tf

 修改后的event_file_writer.py文件为下面这样,修改后进行保存,保存后回到自己的代码文件中重新运行就可以成功了

Logo

有“AI”的1024 = 2048,欢迎大家加入2048 AI社区

更多推荐