tensorflow_core._api.v2.io.gfile has no attribute get_filesystem 问题

‘tensorflow_core._api.v2.io.gfile’ has no attribute ‘get_filesystem’

链接: 参考
博主在学习PyTorch官网Tensorboard的tutorial时,运行这段代码

writer.add_embedding(features,metadata=class_labels,\
label_img=images.unsqueeze(1))writer.close()

时会出现如上问题
尝试卸载tensorflow,创建新环境(只包含pytorch),但还会出现
所以我直接在tensorboard.writer.py文件中加入

import tensorboard as tb
tf.io.gfile = tb.compat.tensorflow_stub.io.gfile

成功解决

你可能感兴趣的:(python运行问题,pytorch,tensorflow)