fp16 support
turboxin opened this issue · comments
hi @longcw, thanks a lot for your excellent work, it really helped!
I am now trying to use crop_and _resize on image_feature_maps with dtype of torch.float16 to speed up training and inference, however it seems that your repo doesn't support fp16 yet throwing following error:
RuntimeError: image.type().scalarType() == torch::ScalarType::Float ASSERT FAILED at roi_aligfloat Tensor (crop_and_resize_gpu_forward at roi_align/src/crop_and_resize_gpu.cpp:27)
frame #0: c10::Error::Error(c10::SourceLocation, std::__cxx11::basic_string<char, std::char_t/miniconda3/lib/python3.6/site-packages/torch/lib/libc10.so)
frame #1: torch::crop_and_resize_gpu_forward(at::Tensor, at::Tensor, at::Tensor, float, int, site-packages/roi_align-0.0.1-py3.6-linux-x86_64.egg/roi_align/crop_and_resize_gpu.cpython-36
frame #2: + 0x157c7 (0x7fc110c767c7 in /usr/local/miniconda3/lib/python3.6gpu.cpython-36m-x86_64-linux-gnu.so)
frame #3: + 0x1598e (0x7fc110c7698e in /usr/local/miniconda3/lib/python3.6gpu.cpython-36m-x86_64-linux-gnu.so)
frame #4: + 0x125f5 (0x7fc110c735f5 in /usr/local/miniconda3/lib/python3.6gpu.cpython-36m-x86_64-linux-gnu.so)
Could you please tell me how can I modify the code to support fp 16? Thank you very much!