Error in compiling custom_ops
I wonder what is the reason for this problem? Usually, this problem is caused by a failure to bind successfully. But since the code has been around for a while, that shouldn't be the reason.
I use
- Windows 11
- MSVC x64 19.38.33130
- python3.10
- torch 2.1
same error
I just updated the get_patches; it should run without compiling. For more information, refer to this code.
same error, how to run without compiling?
This error arises from the use of the deprecated at::DeprecatedTypeProperties in the CUDA code of ALIKED's custom operations. In recent versions of PyTorch, tensor type information is handled using c10::ScalarType. Therefore, invoking tensor.type() in the code can lead to compatibility issues.
For instance, modifying the code as shown below resolved the issue in an environment with torch==2.6.0+cu118.
File: custom_ops/get_patches_cuda.cu
167c167
< AT_DISPATCH_FLOATING_TYPES(input.type(), "get_patches_forward_cuda",
---
> AT_DISPATCH_FLOATING_TYPES(input.scalar_type(), "get_patches_forward_cuda",
206c206
< AT_DISPATCH_FLOATING_TYPES(map_pad.type(), "get_patches_forward_cuda",
---
> AT_DISPATCH_FLOATING_TYPES(map_pad.scalar_type(), "get_patches_forward_cuda",
246c246
< AT_DISPATCH_FLOATING_TYPES(d_map_pad.type(), "get_patches_backward_cuda",
---
> AT_DISPATCH_FLOATING_TYPES(d_map_pad.scalar_type(), "get_patches_backward_cuda",
I hope this helps.