amdegroot / ssd.pytorch

A PyTorch Implementation of Single Shot MultiBox Detector
MIT License
5.14k stars 1.74k forks source link

solution to pytorch==0.4 #175

Open zsp1197 opened 6 years ago

zsp1197 commented 6 years ago

change Hard Negative Mining in multibox_loss.py (line 101) from loss_c[pos] = 0 to loss_c[pos.view(-1, 1)] = 0 Then change loss_l /= N loss_c /= N in the same file to loss_l /= N.float() loss_c /= N.float()

zsp1197 commented 6 years ago

This is not an issue bug a comment.

srslynow commented 6 years ago

Thank you!

zhenxingsh commented 6 years ago

thanks

niaoyu commented 5 years ago

why do we need to add .float()? whether in py2 or py3, it should be the same since loss_l is float