Hi, all,
I got the following import error:
>>> from pytorch3d import _C
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: /data/code11/pytorch3d/pytorch3d/_C.cpython-36m-x86_64-linux-gnu.so: undefined symbol: _ZTIN3c1021AutogradMetaInterfaceE
My config is pytorch==1.4, torchvision==0.5.0, CUDA=10.0. It seems there's conflicts with the packages? Any hints to solve it?
THX!
Does it work if you import pytorch3d before importing _C?
import pytorch3d
from pytorch3d import _C
Are you using the conda package or trying to install from source?
Thanks @jcjohnson @nikhilaravi for your replies.
@jcjohnson ,
import pytorch3d
This line works. But the second line from pytorch3d import _C prompts the above error.
@nikhilaravi ,
I install it from local clone as guided
@amiltonwong were you able to resolve this issue after installing from a local clone?
I think you may need import torch before a line like from pytorch3d import _C, which touches pytorch3d's internals, can possibly work.
@nikhilaravi @bottler , Thanks a lot for your help. It's solved after installing the new updated repo. I confirmed that import torch is needed before from pytorch3d import _C as mentioned by @bottler .
hi @bottler @amiltonwong @jcjohnson @nikhilaravi @likethesky
I installed pytorch3D according to https://github.com/facebookresearch/pytorch3d/blob/master/INSTALL.md
And I still get an error:
File "/userhome/pytorch3d/pytorch3d/renderer/blending.py", line 8, in <module>
from pytorch3d import _C
ImportError: cannot import name '_C'
My system setting:
I have confirmed that
import pytorch
has been added in front of the
from pytorch3d import _C

Thank you in advance!
@Frank-Dz Please open a new issue and paste the output of conda list.
@Frank-Dz I have the same error.Have you solved it?
@bottler
My error is the same as Frank-Dz's which are as follows:
My pip list is:
my sys setting is :
@mengxiangxiang414 Please always open a new issue for things like this. How did you build/install PyTorch3D. It looks like you have installed from a local checkout of the repository, but did you actually build the library successfully? And did you build it with the current environment active? Were there and errors in building? Is there a file with a name beginning with _C in /home/mxx/pytorch3d/pytorch3d or /home/mxx/pytorch3d? Best to open a new issue with a post explaining all this if it is still problematic.
NOTE for future passers-by: If you have an import error with PyTorch3D which you cannot solve, please open a new issue.
@bottler
OK,thanks.
As you said锛孖 have installed from a local clone of the source, but did not actually build the library successfully.
Two bad actions resulted in my error :
CUB library
rm -rf build/ */.so
It was my mistake.
Most helpful comment
I think you may need
import torchbefore a line likefrom pytorch3d import _C, which touches pytorch3d's internals, can possibly work.