当前位置: 首页 > 工具软件 > GFile > 使用案例 >

解决报错:module ‘tensorflow‘ has no attribute ‘gfile‘

束志业
2023-12-01

原因:

报错语句类型:

with tf.gfile.GFile(self.PATH_TO_CKPT, 'rb') as fid:

tensorflow 1.X和tensorflow 2.X不匹配的问题。

解决方法:

with tf.io.gfile.GFile(self.PATH_TO_CKPT, 'rb') as fid:

 类似资料: