What could be reason for getting 0 as boxloss in SSD?


I am trying to SSD network on my own dataset. However, I keep getting boxloss to be 0. Classification loss is not 0. But only box loss is 0.

When my default anchors, labels and class_predictions go through MutliboxTarget, I get 0 for box_target, box_mask, and class_target.

I have tried lot of things

  • Changed size of image
  • Converted image from rectangular to sqare
  • Tried with similar small dataset
  • Random translation and others.
  • Even passed some other dataset through my network (Where the network works fine and Multibox target returns some values apart from 0)
  • Tried classifying on same dataset with 2 classes. (Background, Object)
  • Let it run for long number of ephoces. (But still box loss is 0, class loss approaches 0 and eventually network gets converged only on class loss.
  • Ensured that training_target function works fine (copy pasted the literal code from MXNet object detection module)
  • Even tried it on small network with no body, still mutilbox target returns 0.]
  • Played around with lots of different anchorsizes and ratios.

So my question is what could be wrong? What could be wrong with my dataset? Why does multibox target always return 0 for everything?

And what exactly does a multibox target function do?


I meet the same problem two days ago. I found the problem is that the shape of label for every sample in one batch is different. Did you check that?


Yes my labels are padded to 117. Every label. So I have 117 label per image. (Batch size, 117, 5)


Are you using SSD from gluon CV or your own implementation?