ALIKED icon indicating copy to clipboard operation
ALIKED copied to clipboard

Error in compiling custom_ops

Open KevenGe opened this issue 2 years ago • 4 comments

WindowsTerminal_eHWRX5IQsq

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

KevenGe avatar Dec 11 '23 10:12 KevenGe

same error

Ever-Bright-V avatar Apr 27 '24 15:04 Ever-Bright-V

I just updated the get_patches; it should run without compiling. For more information, refer to this code.

Shiaoming avatar May 05 '24 01:05 Shiaoming

same error, how to run without compiling?

ThirstforSisyphus avatar May 26 '24 01:05 ThirstforSisyphus

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.

yuki-inaho avatar Feb 15 '25 13:02 yuki-inaho