create more than one tf.record files for object dection training
Now the object detection API provides the sample code to create tf.record file for PASCAL VOC in create_pascal_tf_record.py
But it only generates one file training and one file for validation. This will cause the single file is very large and hard to load into memory, especially on our own dataset. furthermore, the model config file can only assign one file for training and validation as well in 'input_path'.
We need a more flexible to let training process to read more than one files one by one, just like in classification model, train-001.record, train-002.record...
You can refer to this script pascalvoc_to_tfrecords.py, this SSD implemented in Tensoflow creates a list of tfrecords.
thanks, but in config file for training, you can only assign one file but not a folder path, which contains training files.
I guess this is a feature request, but not sure whether community support is feasible. @martinwicke ?
Which model is this for? Whoever is in the readme should take a look.
for detection model:
https://github.com/tensorflow/models/tree/master/object_detection/samples/configs
now all config files here can only read one training and validation file, instead of assign a folder.
You can assign input_path such as "YOUR_TFREOCRDS/train_*.tfrecords"
Thanks @balansky for the clarification.
It seems the create_pascal_tf_record.py creates tfrecord for a single object category. How do we train for multiple object categories using the object detection API?
I have the same question for multiple classes. Can anyone help with this?
Hi @balansky ,
For training multiple classes, do you need individual train and val tfrecords for each class? And then, would you need to train the network separately for each class?
Many of my train images contain object instances across classes. It would be most efficient to keep all images in one directory and create single tfexamples for each image that can list annotations for multiple classes. Can the object detection api train this way for multiple labels/classifications?
Alternatively, @tvkpz how did you end up any creating tfrecords and training for multiple categories?
@tvkpz your question is wrong. you can always train more than one class in one tr.record. One image can contains many different classes. It is not one tf.record file for one class. This is wrong way to train. Shuffle classes are very important to make network converge.
Hi There, We are checking to see if you still need help on this, as this seems to be considerably old issue. Please update this issue with the latest information, code snippet to reproduce your issue and error you are seeing. If we don't hear from you in the next 7 days, this issue will be closed automatically. If you don't need help on this issue any more, please consider closing this.
Can I make tf_record for multiple classes at once?