我正在尝试使用张量流 api 中的对象检测教程。我正在使用 python 3 和张量流版本 2。但是出现以下错误。我尝试了几种方法:
File "C:\Aniruddhya\object_detection\object_detection\utils\label_map_util.py", line 137, in load_labelmap
with tf.gfile.GFile(path, 'r') as fid:
AttributeError: module 'tensorflow' has no attribute 'gfile'
有人可以帮我运行这个吗?代码链接: https ://drive.google.com/drive/u/3/folders/1XHpnr5rsENzOOSzoWNTvRqhEbLKXaenL
原文由 Andy 发布,翻译遵循 CC BY-SA 4.0 许可协议
它在 TensorFlow 2 中没有被调用。您可能正在使用 TensorFlow 1 教程。
版本 1
tf.gfile.GFile
https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/io/gfile/GFile版本 2
tf.io.gfile.GFile
https://www.tensorflow.org/api_docs/python/tf/io/gfile/GFile