I am trying to generate TFRecord files from Pascal VOC format dataset. I am following this guide and used this instructions to create pascal_train.record and pascal_val.record.
I have already prepared annotations, images and image sets in ImageSets -> Main. Also generated label map in pascal_label_map.pbtxt.
Now, when run following command from tf_worspace/models:
python3 object_detection/create_pascal_tf_record.py \
--label_map_path=object_detection/data/pascal_label_map.pbtxt \
--data_dir=VOCdevkit --year=VOC2012 --set=train \
--output_path=pascal_train.record
I get:
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/errors_impl.py", line 466, in raise_exception_on_not_ok_status pywrap_tensorflow.TF_GetCode(status)) tensorflow.python.framework.errors_impl.NotFoundError: VOCdevkit/VOC2012/ImageSets/Main/marlboro_red_train.txt
My project structure is as follow:
- tf_workspace
- models (TF staff here...)
- object_detection
- VOCdevkit
- VOC2012
- Annotations
- ImageSets
- Action (my annotations here)
- Layout
- Main (my imagesets here)
- marlboro_red_train.txt
- marlboro_red_val.txt
- marlboro_red_trainval.txt
- ...
- Segmentation
- JPEGImages (my images here)
- SegmentationClass
- SegmentationObject
- VOC2012
- VOCdevkit
- object_detection
- models (TF staff here...)
The file that script cannot find for some reasons exist in that directory, I have checked few times.
Be sure I changed following line in create_pascal_tf_record.py:
examples_path = os.path.join(data_dir, year, 'ImageSets', 'Main',
'aeroplane_' + FLAGS.set + '.txt')
to:
examples_path = os.path.join(data_dir, year, 'ImageSets', 'Main',
'marlboro_red_' + FLAGS.set + '.txt')
So what is going on? Can anybody explain why it gives such error, please! Thanks in advance for any hint!