InternImage icon indicating copy to clipboard operation
InternImage copied to clipboard

RuntimeError: expected scalar type Half but found Float: issues when I tried to run DCN on pytorch without C++

Open AndywithCV opened this issue 2 years ago • 2 comments

Since I cannot compile C++ in my environment because of the imcompatibility of pakages, I then tried to use DCN with pytorch, but I encounter and error as below:

File "/root/data/andy/newyolov8/ultralytics/ultralytics/nn/modules/block.py", line 708, in dcnv3_core_pytorch sampling_input_ = F.grid_sample( File "/root/miniconda3/envs/newyolov8benchmark/lib/python3.8/site-packages/torch/nn/functional.py", line 4244, in grid_sample return torch.grid_sampler(input, grid, mode_enum, padding_mode_enum, align_corners) RuntimeError: expected scalar type Half but found Float

Please help me to take a look!!!

AndywithCV avatar Oct 19 '23 01:10 AndywithCV

and in the first part def _get_reference_points,there are still float32 remain. You need to change it into float16 or an error:meshgrid need the same type. And so on, in issue dcnv3 in modules also have two float need to change into float16. Thank you for your thought.

GoblinCraftman avatar Nov 08 '23 01:11 GoblinCraftman