Search code examples
pythonmachine-learningtensorflowobject-detectiontensorboard

TensorFlow Object Detection API trains only one class from several


Im running training process with TF Object Detection API on my own dataset with several classes, however after pretty big amount of steps (about 20k) I can see at PerformanceByCategory menu in TensorBoard that mAP is increasing only for one category, other are not even started.

enter image description here

My dataset is in PascalVOC format and I was following this answer to create it. After data preparation I have generated Pascal records, edited label map and pipeline config, downloaded all the staff with ssd model checkpoints to Google Cloud Platform and started training and evaluation jobs accordingly to Object Detection API Documentation.

But it seems from TensorBoard that something is wrong with data or something other because nothing happens with my another classes.

Are there any hints or features when training Object Detection API with several classes?

Thanks for any help in advance!

[EDITED]:

So having tried to train model with PascalVOC dataset they provide by default in tutorial I noticed that their Pascal records are much larger than mine. I opened them in text editor and there were references for every class from ImageSets, however my records contain references for only that class I pointed in create_pascal_tf_records.py.

What am I missing guys? Please help!


Solution

  • OK, I think I have figured out what was wrong.

    The main problem was I made ImageSets uncorrectly. For each class I have been adding their corresponding lists of images, so each train and val files were different in my case.

    Due to this answer:

    The punchline is that we currently only look at the first column of the aeroplane_train.txt file (which is the same as the other xxx_train.txt files) and lets us figure out the path for each image in the training set.

    Because of every file is different the create_pascal_tf_records.py was picking paths to only my first class.

    Hope this will help someone else.