Closed amiltonwong closed 4 years ago
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,I have installed from a local clone of the source, but did not actually build the library successfully. Two bad actions resulted in my error :
I ignored the
CUB library
i retryed installing it without the
rm -rf build/ */.so
It was my mistake.
receiving the same error however when I import chamfer loss.
Traceback (most recent call last): File "point2param.py", line 38, in <module> from pytorch3d.loss import chamfer_distance File "/home/aradhya/anaconda3/envs/torchenv/lib/python3.7/site-packages/pytorch3d/loss/__init__.py", line 4, in <module> from .chamfer import chamfer_distance File "/home/aradhya/anaconda3/envs/torchenv/lib/python3.7/site-packages/pytorch3d/loss/chamfer.py", line 7, in <module> from pytorch3d.ops.knn import knn_gather, knn_points File "/home/aradhya/anaconda3/envs/torchenv/lib/python3.7/site-packages/pytorch3d/ops/__init__.py", line 5, in <module> from .graph_conv import GraphConv File "/home/aradhya/anaconda3/envs/torchenv/lib/python3.7/site-packages/pytorch3d/ops/graph_conv.py", line 6, in <module> from pytorch3d import _C ImportError: /home/aradhya/anaconda3/envs/torchenv/lib/python3.7/site-packages/pytorch3d/_C.cpython-37m-x86_64-linux-gnu.so: undefined symbol: _ZTIN3c1021AutogradMetaInterfaceE
pytorch==1.7.1
torchvision==0.8.2
cudatoolkit=10.2
pytorch3d==0.2.0
@aradhyamathur Please open a new issue with more details of your setup and how you installed.
Hi, all,
I got the following import error:
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!