Deformable-Convolution-V2-PyTorch
Deformable-Convolution-V2-PyTorch copied to clipboard
Solution about `ImportError: undefined symbol`
I download the code and successfully compile it, I can run the test.py file, and pass almost every test but with a small mistake(according to the annotations, it's not a big deal). When I try to import DCN and use the module in my code, the error occurs:
ImportError:~/anaconda3/lib/python3.7/site-packages/DCN-1.0-py3.7-linux-x86_64.egg/DCN.cpython-37m-x86_64-linux-gnu.so: undefined symbol: _ZN2at19UndefinedTensorImpl10_singletonE
The DCN package was installed in my site-packages, it's really strange that when I import another package before import DCN, this problem solved! 😳 How STRANGE it is!
from torch.autograd.function import once_differentiable
import DCN
or you should rename DCN-1.0-py3.7-linux-x86_64.egg to DCN or dcn
To use a custom extension, you may refer to the official tutorial. As stated in the documentation,
Just be sure to import torch first, as this will resolve some symbols that the dynamic linker must see
I rename DCN-1.0-py3.7-linux-x86_64.egg to DCN. running python test.py. error:AttributeError: module 'DCN' has no attribute 'deform_conv_forward'
I ran into this error: undefined symbol: __cudaPopCallConfiguration
and waste time to find the solution all the day.
Finally, check the environment version follow this link:
https://rusty1s.github.io/pytorch_geometric/build/html/notes/installation.html
I found the conda virtual env's and system's cuda version do not match.
After I create a new env, this issue gone.
or you should rename DCN-1.0-py3.7-linux-x86_64.egg to DCN or dcn
I met import error. And rename the directory name import worked.
but I should use DCN.deform_conv_forward it will occur same problem. So what should I do ?
Traceback (most recent call last): File "<stdin>", line 1, in
ImportError: libc10.so: cannot open shared object file: No such file or directory
Sorry for careless. Finally I run the code well use the advice from @hellock