Model Maker: Image format not JPEG

I’m in the process of fine-tuning EfficientDetLite0 with information from this tutorial:

https://www.tensorflow.org/lite/tutorials/model_maker_object_detection#quickstart

I’m using object_detector.DataLoader.from_csv() to load my data which uses PNG image files.

The from_csv api points to this documentation for the csv format which mention that PNG files are allowed:

References to non-image files (such as PDF or PSD files). Likewise, files that are not image files (JPEG, PNG, GIF, BMP, or ICO) but that have been renamed with an image extension will cause an error.

Even the example is using PNG files.

However on my side I get an error:

Traceback (most recent call last):
  File "rgb_finetune.py", line 125, in <module>
    csv_file_path, images_dir=args.images)
  File "/azureml-envs/tensorflow/lib/python3.7/site-packages/tensorflow_examples/lite/model_maker/core/data_util/object_detector_dataloader.py", line 292, in from_csv
    cache_writer.write_files(cache_files, csv_lines=csv_lines)
  File "/azureml-envs/tensorflow/lib/python3.7/site-packages/tensorflow_examples/lite/model_maker/core/data_util/object_detector_dataloader_util.py", line 258, in write_files
    ann_json_dict=ann_json_dict)
  File "/azureml-envs/tensorflow/lib/python3.7/site-packages/tensorflow_examples/lite/model_maker/third_party/efficientdet/dataset/create_pascal_tfrecord.py", line 134, in dict_to_tf_example
    raise ValueError('Image format not JPEG')
ValueError: Image format not JPEG

Any idea why I get this error?

@Yuqi_Li might be able to help here

Any news on this? I’d like to get rid of the extra png to jpg conversion step short to medium term.

Is that the specific TFrecord utility for Pascal dataset support only jpeg:

1 Like