我正在尝试使用 tensorflow api中的对象检测教程。我正在使用python 3和 tensorflow 版本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
最佳答案
在TensorFlow 2中没有这样称呼。您可能正在使用TensorFlow 1教程。
版本1tf.gfile.GFile
https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/io/gfile/GFile
版本2tf.io.gfile.GFile
https://www.tensorflow.org/api_docs/python/tf/io/gfile/GFile
关于python-3.x - 错误: Module 'tensorflow' has no attribute 'gfile' error while running tensorflow object detection api tutorial,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58363136/