nicknochnack / TFODCourse

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AttributeError: module 'tensorflow' has no attribute 'gfile'

jkolosowski opened this issue · comments

Getting this error, followed up this one tensorflow/tensorflow#31315 changing tf.io.gfile and no luck, any ideas?

File ~/TFODCourse/tfod/lib/python3.10/site-packages/object_detection/utils/config_util.py:96, in get_configs_from_pipeline_file(pipeline_config_path, config_override)
     82 """Reads config from a file containing pipeline_pb2.TrainEvalPipelineConfig.
     83 
     84 Args:
   (...)
     93     corresponding config objects.
     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'

Replace:

with tf.gfile.GFile(pipeline_config_path, "r") as f:

With:

with tf.io.gfile.GFile(pipeline_config_path, "r") as f:

Do this in config_util.py