Scalsol / mega.pytorch

Memory Enhanced Global-Local Aggregation for Video Object Detection, CVPR2020
Other
565 stars 115 forks source link

How to enable batch size > 1?Any advices? #3

Closed TyroneLi closed 4 years ago

TyroneLi commented 4 years ago

I find that setting batch_size > 1 in config file could continue training. So is that right? Or it is the wrong way to use batch_size > 1?

TyroneLi commented 4 years ago

I find that setting batch_size > 1 in config file could continue training. So is that right? Or it is the wrong way to use batch_size > 1?

Oh I found even doing that, training procedure still using batch_size = 1.

Scalsol commented 4 years ago

If you want to use batch size > 1, you should first change the behavior of BatchCollator in mega_core/data/collate_batch.py. Then you should modify mega_core/engine/trainer.py and mega_core/engine/inference.py to make the training and inference procedure compatible with the behavior of BatchCollator. And also the model should modified correspondingly. Setting batch_size > 1 is the wrong way. Because the BatchCollator only use 1 image.