krumo / Domain-Adaptive-Faster-RCNN-PyTorch

Domain Adaptive Faster R-CNN in PyTorch
MIT License
304 stars 68 forks source link

why set to float?What will happen if using the default dtype? #11

Closed Liyw979 closed 4 years ago

Liyw979 commented 4 years ago

https://github.com/krumo/Domain-Adaptive-Faster-RCNN-PyTorch/blob/276fcf8ae41be483db94682722c8093703750fdd/maskrcnn_benchmark/modeling/da_heads/loss.py#L70-L72

https://github.com/krumo/Domain-Adaptive-Faster-RCNN-PyTorch/blob/276fcf8ae41be483db94682722c8093703750fdd/maskrcnn_benchmark/modeling/da_heads/loss.py#L86-L88

krumo commented 4 years ago

Hi, you could try removing this type conversion yourself and see what would happen. If my memory is correct, F.binary_cross_entropy_with_logits() requires a float type input otherwise it will throw an error. Please fix me if I am wrong.

Liyw979 commented 4 years ago

I use the default dtype which works fine.Maybe this function has been updated. Thanks for you reply