尝试了安装tensorflow-io发现没用,后查看环境的tensorflow版本发现是2.0以上,
tf.io的用法是1.0版本的用法,最简单的方法,将Tensorflow卸载了,安装1.xx版本。
或者在保持tensorflow的最新版本下,将代码改为
from tensorboard.compat.tensorflow_stub import io
之后将代码段中的tf.io直接替换为io
亲测有效。
TensorFlow报AttributeError: module tensorflow has no attribute io
最新推荐文章于 2024-03-18 17:33:27 发布