AttributeError: module ‘tensorflow._api.v2.io.gfile’ has no attribute 'get_filesystem’错误
在运行pytorch官方历程时出现题示错误
1.原因
在同一环境中安装pytorch和tensorflow以及tensorboard,产生冲突
2.解决方案(以下两种都可)
第一种:
将tensorflow安装到其他环境中
第二种:
在代码开头添加:
import tensorflow as tf
import tensorboard as tb
tf.io.gfile = tb.compat.tensorflow_stub.io.gfile
参考链接: link.