abdelrahman-gaber / tf2-object-detection-api-tutorial

Tensorflow 2 Object Detection API Tutorial. This tutorial will take you from installation, to running pre-trained detection model, and training your model with a custom dataset, then exporting it for inference.
MIT License
114 stars 52 forks source link

generate_tfrecord.py #10

Open AbdullahJirjees opened 3 years ago

AbdullahJirjees commented 3 years ago

Hello Abdelrahman I am getting an error in the file of generate_tfrecord.py in

from object_detection.utils import dataset_util from object_detection.utils import label_map_util

I checked my environment and the TF object detection, everything seems good, can you share with me what you think about this issue? Thank you

thiemoToadi commented 2 years ago

It is because it seems like the object_detection library if you installed it from pypi uses tf1 code. You need to change line 132 in label_map_util to with tf.io.gfile.GFile(path, 'r') as fid: instead of tf.gfile.Gfile()