Model Maker: Image format not JPEG

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

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 "", 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/", 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/", line 258, in write_files
  File "/azureml-envs/tensorflow/lib/python3.7/site-packages/tensorflow_examples/lite/model_maker/third_party/efficientdet/dataset/", 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