我尝试更改tf.gfile.GFile
为 tf.io.gfile.GFile 并且也尝试过import tensorflow.compat.v1 as tf
但没有任何效果。它没有读取新保存的文件。修改后我保存了。
AttributeError Traceback (most recent call last)
<ipython-input-52-efc7822bb0d7> in <module>
----> 1 config = config_util.get_configs_from_pipeline_file(CONFIG_PATH)
~/opt/anaconda3/lib/python3.8/site-packages/object_detection/utils/config_util.py in get_configs_from_pipeline_file(pipeline_config_path, config_override)
94 """
95 pipeline_config = pipeline_pb2.TrainEvalPipelineConfig()
---> 96 with tf.gfile.GFile(pipeline_config_path, "r") as f:
97 proto_str = f.read()
98 text_format.Merge(proto_str, pipeline_config)
AttributeError: module 'tensorflow' has no attribute 'gfile''''