tf2-object-detection-api-tutorial icon indicating copy to clipboard operation
tf2-object-detection-api-tutorial copied to clipboard

generate_tfrecord.py

Open AbdullahJirjees opened this issue 4 years ago • 1 comments
trafficstars

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

AbdullahJirjees avatar Oct 07 '21 14:10 AbdullahJirjees

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()

thiemoToadi avatar Nov 15 '21 11:11 thiemoToadi