daniilidis-group / neural_renderer

A PyTorch port of the Neural 3D Mesh Renderer
Other
1.14k stars 254 forks source link

Error running examples #35

Closed chrander closed 5 years ago

chrander commented 5 years ago

Thanks for putting this implementation together.

I can successfully run python setup.py install, but I'm running into the following error when I try to run the examples. If I run python examples/example1.py, I get this output:

Traceback (most recent call last):
  File "examples/example1.py", line 12, in <module>
    import neural_renderer as nr
  File "/home/abc/miniconda3/envs/neur3/lib/python3.6/site-packages/neural_renderer-1.1.3-py3.6-linux-x86_64.egg/neural_renderer/__init__.py", line 3, in <module>
    from .load_obj import load_obj
  File "/home/abc/miniconda3/envs/neur3/lib/python3.6/site-packages/neural_renderer-1.1.3-py3.6-linux-x86_64.egg/neural_renderer/load_obj.py", line 8, in <module>
    import neural_renderer.cuda.load_textures as load_textures_cuda
ImportError: /home/abc/miniconda3/envs/neur3/lib/python3.6/site-packages/neural_renderer-1.1.3-py3.6-linux-x86_64.egg/neural_renderer/cuda/load_textures.cpython-36m-x86_64-linux-gnu.so: undefined symbol: _ZN2at5ErrorC1ENS_14SourceLocationESs

I'm using a CentOS7 Linux system and am running in a conda virtual environment with Python 3.6, Pytorch 0.4.0, cudatoolkit 8.0, and cudadnn 7.1.3. I have tried other versions of Pytorch, but haven't had luck with them either. I can successfully import torch and run vanilla Pytorch operations in the environment, so the Pytorch installation seems to be okay.

Ailuridae commented 5 years ago

This error seems to originate in non-matching PyTorch versions. Have you tried deleting the generated binaries, in order to trigger a re-compile? Maybe two different PyTorch versions were or are somehow used during compilation and execution. A similar issue was also reported in a PyTorch library itself.

chrander commented 5 years ago

Interesting, thanks for that link.

It looks like it's something to do with the conda environment. I wasn't able to directly track down the source of the error, but I got everything to work inside an nvidia-docker container, including with other versions of Pytorch (specifically Pytorch 1.0). So at least for me, finding an alternative to conda seemed to work.

chrander commented 5 years ago

In any case, it looks like the problem is outside the scope of this project, so I'm closing this issue.

Weipeilang commented 5 years ago

@chrander I meet the same qusetion,Could you tell me how to solve it?