The faster rcnn module does not support batch_size > 1 for each clone
https://github.com/tensorflow/models/blob/b63a73df70656ecfcd2d50bfc98b09b3ce06f635/research/object_detection/trainer.py#L155
The above line has a concat operation which only works for single image or images with the same width/height ratio, i.e., the same size after resize.
This seems to be a bug; because in https://github.com/tensorflow/models/blob/01aa7a4a6190bf021f448dee26fc649f4b47753e/research/object_detection/meta_architectures/faster_rcnn_meta_arch.py#L101, the comments show "When training with a relative large batch size (e.g. 8), it could be desirable to enable batch norm update." This indicates the authors plan to support more batch sizes. Also, I believe that this comment is misleading. Set batch norm parameters not trainable is OK for fine tuning, but NOT acceptable for training from scratch. If training from scratch, even if the batch size is 1, the batch norm still need to be set trainable.
@derekjchow , could you please take a look?
how to make batch_size placeholder
I too am running into this issue. Can we use a different resizer function for faster-rcnn?
From my reading through the codes, it is not a just simple modification task, such as make it a placeholder, it relates to many functions. That concat not supporting more than 1 sample is just one of them. This is because that Faster R-CNN default setting use resizer that preserves the width/height ratio of images; this leads to different sizes of samples after resizing, and therefore cannot be simply processed together like fixed size resizers.
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.