Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: '_OpNamespace' object has no attribute 'get_patches_forward' #18

Open
LooperzZ opened this issue May 20, 2024 · 2 comments

Comments

@LooperzZ
Copy link

INFO:root:Loading 5 images
loading D:\DL_matching\ALIKED-main\models\aliked-n16rot.pth
C:\software\Anaconda3\envs\pytorch_gpu\lib\site-packages\torch\functional.py:478: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\native\TensorShape.cpp:2895.)
return _VF.meshgrid(tensors, **kwargs) # type: ignore[attr-defined]
INFO:root:Press 'space' to start.
Press 'q' or 'ESC' to stop!
Traceback (most recent call last):
File "C:\software\Anaconda3\envs\pytorch_gpu\lib\site-packages\torch_ops.py", line 198, in getattr
op, overload_names = torch._C._jit_get_operation(qualified_op_name)
RuntimeError: No such operator custom_ops::get_patches_forward

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "D:\DL_matching\ALIKED-main\demo_pair.py", line 116, in
pred_ref = model.run(img_rgb)
File "D:\DL_matching\ALIKED-main\nets\aliked.py", line 166, in run
pred = self.forward(img_tensor)
File "D:\DL_matching\ALIKED-main\nets\aliked.py", line 148, in forward
descriptors, offsets = self.desc_head(feature_map, keypoints)
File "C:\software\Anaconda3\envs\pytorch_gpu\lib\site-packages\torch\nn\modules\module.py", line 1130, in call_impl
return forward_call(*input, **kwargs)
File "D:\DL_matching\ALIKED-main\nets\blocks.py", line 227, in forward
patch = self.get_patches_func(xi, kptsi_wh.long(), self.kernel_size) # [N_kpts, C, K, K]
File "D:\DL_matching\ALIKED-main\custom_ops_init
.py", line 18, in forward
patches = torch.ops.custom_ops.get_patches_forward(fmap, points, kernel_size)
File "C:\software\Anaconda3\envs\pytorch_gpu\lib\site-packages\torch_ops.py", line 202, in getattr
raise AttributeError(f"'_OpNamespace' object has no attribute '{op_name}'") from e
AttributeError: '_OpNamespace' object has no attribute 'get_patches_forward'

@Magico23
Copy link

I'm having the same problem, have you solved it now

@NemB0t
Copy link

NemB0t commented Jul 31, 2024

I had the same problem. I faced the issue because I had not built the custom ops as mentioned by the author. Once I build it it got fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants