rtabmap icon indicating copy to clipboard operation
rtabmap copied to clipboard

torch import error with superglue

Open fbliman opened this issue 1 year ago • 1 comments

Hi,

I am having a python torch version problem I guess.

this is the error I get when trying to use superglue

Details

[ERROR] (2023-08-13 15:10:40.026) PyMatcher.cpp:61::PyMatcher() Module "rtabmap_superglue" could not be imported! (File="/home/fede/rtabmap/archive/2022-IlluminationInvariant/scripts/SuperGluePretrainedNetwork/rtabmap_superglue.py") [ERROR] (2023-08-13 15:10:40.026) PyMatcher.cpp:62::PyMatcher() Traceback (most recent call last):

File "/home/fede/rtabmap/archive/2022-IlluminationInvariant/scripts/SuperGluePretrainedNetwork/rtabmap_superglue.py", line 10, in import torch

File "/usr/local/lib/python3.8/dist-packages/torch/init.py", line 229, in from torch._C import * # noqa: F403

ImportError: /usr/local/lib/python3.8/dist-packages/torch/lib/libtorch_python.so: undefined symbol: _ZNK5torch3jit5Graph8toStringEb

but if I run the scrpit directly from the shell it works:

Details

~/rtabmap/archive/2022-IlluminationInvariant/scripts$ python SuperGluePretrainedNetwork/rtabmap_superglue.py SuperGlue python init() Loaded SuperGlue model ("indoor" weights)

I am on ubuntu 20.04 python 3.8 I have installed pytorch via pip and I have compiled rtabmap with libtorch 2.0.1

Thanks

fbliman avatar Aug 13 '23 18:08 fbliman

See also https://github.com/introlab/rtabmap/issues/599#issuecomment-1676467175

matlabbe avatar Aug 13 '23 22:08 matlabbe