pytorch3d icon indicating copy to clipboard operation
pytorch3d copied to clipboard

import error : from pytorch3d import _C

Open sytest7 opened this issue 3 years ago • 5 comments

Traceback (most recent call last): File "inference.py", line 9, in from renderer import Estimator3D File "/content/Occlusion-Robust-3D-Face-CFR-GAN/renderer.py", line 19, in from pytorch3d.renderer import TexturesVertex File "/usr/local/lib/python3.7/dist-packages/pytorch3d/renderer/init.py", line 3, in from pytorch3d.renderer.blending import BlendParams,hard_rgb_blend,sigmoid_alpha_blend,softmax_rgb_blend File "/usr/local/lib/python3.7/dist-packages/pytorch3d/renderer/blending.py", line 9, in from pytorch3d import _C ImportError: /usr/local/lib/python3.7/dist-packages/pytorch3d/_C.cpython-37m-x86_64-linux-gnu.so: undefined symbol: _ZNK2at6Tensor7is_cudaEv

sytest7 avatar Aug 30 '22 11:08 sytest7

This is usually due to a mismatch in the version of pytorch which pytorch3d was built with and the version of pytorch which you have at runtime. How did you install pytorch and how did you install pytorch3d?

bottler avatar Aug 31 '22 13:08 bottler

This is usually due to a mismatch in the version of pytorch which pytorch3d was built with and the version of pytorch which you have at runtime. How did you install pytorch and how did you install pytorch3d?

I have the same error.And I install pytorch by conda install pytorch==1.8.0, and install pytorch3d by conda install pytorch3d

cocoshe avatar Sep 16 '22 12:09 cocoshe

This is usually due to a mismatch in the version of pytorch which pytorch3d was built with and the version of pytorch which you have at runtime. How did you install pytorch and how did you install pytorch3d?

I have the same error.And I install pytorch by conda install pytorch==1.8.0, and install pytorch3d by conda install pytorch3d

I just solve the error, I just use pip uninstall torch, and find that the pytorch 1.12.1 is uninstalled. But when I use conda list and find this JOQMC{RDGFV}3W$(%05T)1R

However, I just uninstall the torch, then there is no error when I import pytorch3d. But I don't know why, maybe someone can explain it?

cocoshe avatar Sep 16 '22 13:09 cocoshe

Having pytorch3d will let you import pytorch3d. The mismatch error will only show up if you import or use certain things. Possibly import pytorch3d.structures is enough.

bottler avatar Sep 16 '22 13:09 bottler

I met the same problem when installing pytorch3d using conda. Just install the package from the source.

pip install "git+https://github.com/facebookresearch/pytorch3d.git@stable"

SCZwangxiao avatar Aug 09 '23 08:08 SCZwangxiao