I am trying out Tensorflow Object Detection API with a custom dataset and currently hitting a wall with several tutorials at the same place of generation of .record files from xml files.
For image labelling I have used labelImg set in Pascal VOC format
There are several scripts out there for a such conversion like in a documentation titled generate_tfrecord.py (it's written as text) but it and a few others fails to run with tensorflow 2 at two outdated lines:
# the first
flags = tf.app.flags
# second at the end of the document
tf.app.run()
I could fix first with
from absl import app, flags
flags = app.flags
but the last one fails even when you use app.run()
with error TypeError: run() missing 1 required positional argument: 'main'
Since I just have a simple custom dataset, I figured I cannot use object_detection/dataset_tools/create_pascal_tf_record.py
since it requires a year of the pascal dataset and probably also requires specific dataset structure.
Is there a script to generate .record that is working with Tensorflow 2 or could you please point me how to fix those scripts to work with Tensorflow 2 ?