toandaominh1997 / EfficientDet.Pytorch

Implementation EfficientDet: Scalable and Efficient Object Detection in PyTorch
MIT License
1.44k stars 305 forks source link

Feat_channels in retinahead should be W_bifpn #126

Open rmcavoy opened 4 years ago

rmcavoy commented 4 years ago

Box/class prediction network – we fix their width to be always the same as BiFPN (i.e., Wpred = Wbifpn), but

The feat_channels variable used in the retinahead should be equal to Wbifpn instead of being fixed at a default of 256 according to the above quote from the paper.

turner-rovco commented 4 years ago

I assume this is also true for the number of layers in the RetinaHead, there is a config parameter called D_class that seems to specify the right number of layers, but the param doesn't appear to be used in efficientdet.py. It defaults to 4.

rmcavoy commented 4 years ago

@turner-rovco That is a separate issue yes but it is one of the other things that needs to be fixed along with switching to depthwise separable convolutions and ensuring there is a batch norm after every depthwise separable convolution.

tadbeer commented 4 years ago

Hi @rmcavoy , @turner-rovco I am trying to train this on my own dataset, but cant achieve a successfull training, that is, the MAP is not increasing with increasing epochs. Have you tried training on your own dataset? Could you kindly get in touch with me?

rmcavoy commented 4 years ago

@tadbeer Did you remove the problem where the maker of this repo accidentally randomized all the weights in the backbone after loading the pretrained weights? This error makes it nearly impossible to train as you need a good feature map to even start training the bifpn and the classification network. If you delete that mistake at the bottom of efficientnet.py's init function, you at least stand a chance of training something (though you would also need to fix all the mistakes I have mentioned in other issues of this to make it a true EfficientDet). Also I don't know how much you have in the way of computation resources but you shouldn't expect it to stably train on a single gpu as I found I needed batch sizes 28 (fit on four gpus for me) to train EfficientDetD1 and the original paper recommends 64 as they were on a large TPU machine.

zylo117 commented 4 years ago

Hi @rmcavoy , @turner-rovco I am trying to train this on my own dataset, but cant achieve a successfull training, that is, the MAP is not increasing with increasing epochs. Have you tried training on your own dataset? Could you kindly get in touch with me?

you can try my efficientdet, which is a totally exact re-implement of official efficientdet with pretrained weights from D0-D7, I've train on some custom dataset, the result seems nice.

https://github.com/zylo117/Yet-Another-EfficientDet-Pytorch