how i solve an error while make tfrecord file?

230 views Asked by At

So guys i've meet an error for this script

'''python generate_tfrecord.py --csv_input train_labels.csv --image_dir train --labelmap_dir label_map.pbtxt --output_path train.record'''

and then the comment is like this:

Traceback (most recent call last):
  File "generate_tfrecord.py", line 15, in <module>
    from object_detection.utils import dataset_util
ImportError: No module named object_detection.utils
1

There are 1 answers

0
Dieter Maes On

Your generate_tfrecord.py cannot find your object detection utils location.

You'll need to clone/download the tensorflow object detection code and then you have 2 options:

  • place the file in the research folder and run it there

or

  • at the top in your python file add the line:

    sys.path.append('/Users/ path to tensorflow code /models/research')

(fill in the correct path to the location where the tensorflow code is on your device)