Skip to content

ImportError: dlopen(): Symbol not found after installation #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
semihcanturk opened this issue Feb 7, 2020 · 15 comments
Closed

ImportError: dlopen(): Symbol not found after installation #26

semihcanturk opened this issue Feb 7, 2020 · 15 comments
Labels
bug Something isn't working

Comments

@semihcanturk
Copy link

After installing the requirements, running the render_textured_meshes.ipynb fails on the first cell with the following error:

ImportError                               Traceback (most recent call last)

<ipython-input-5-ce664553dc67> in <module>
      8 
      9 # Data structures and functions for rendering
---> 10 from pytorch3d.structures import Meshes, Textures
     11 from pytorch3d.renderer import (
     12     look_at_view_transform,

~/PycharmProjects/pytorch3d/pytorch3d/structures/__init__.py in <module>
      1 # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
      2 
----> 3 from .meshes import Meshes
      4 from .textures import Textures
      5 from .utils import (

~/PycharmProjects/pytorch3d/pytorch3d/structures/meshes.py in <module>
      4 import torch
      5 
----> 6 from pytorch3d import _C
      7 
      8 from . import utils as struct_utils

ImportError: dlopen(/Users/semo/PycharmProjects/pytorch3d/pytorch3d/_C.cpython-37m-darwin.so, 2): Symbol not found: __Z23RasterizeMeshesFineCudaRKN2at6TensorES2_ifiib
  Referenced from: /Users/semo/PycharmProjects/pytorch3d/pytorch3d/_C.cpython-37m-darwin.so
  Expected in: flat namespace
 in /Users/semo/PycharmProjects/pytorch3d/pytorch3d/_C.cpython-37m-darwin.so

Instructions To Reproduce the Issue:

  1. PyCharm -> Get From Version Control -> https://github.com/facebookresearch/pytorch3d
  2. Install requirements
  3. run python setup.py build develop from root directory
  4. run render_textured_meshes.ipynb

Any help is much appreciated, thanks!

@nikhilaravi
Copy link
Contributor

@semihcanturk this looks like an error with building CUDA. Can you share more details about the environment you are using e.g. CUDA version?

@semihcanturk
Copy link
Author

I was trying to get it working on CPU only, don't have CUDA available unfortunately. INSTALL.md mentions some components have CPU implementations in C++/Pytorch as well, but I assume this particular tutorial requires GPU implementations in this case.

@REscanDon
Copy link

REscanDon commented Feb 7, 2020

See also #29 (which is a dupe of this issue but with a different title and seen running in the tutorial colab notebooks context)

@sinanmut
Copy link

sinanmut commented Feb 7, 2020

Hi,
I have cuda 10.0 and t trying to build the package with "python setup.py install --user". I am getting the save error for "from pytorch3d.structures import Meshes".

@nikhilaravi
Copy link
Contributor

@sinanmut @REscanDon @semihcanturk I am looking into this and will report back soon.

@nikhilaravi
Copy link
Contributor

@sinanmut your issue is now resolved. @semihcanturk we are making some changes so the library can be built for cpu only. We will try to get this fixed ASAP. In the meantime please see #29 for instructions on how to run the tutorials in a collab environment.

@nikhilaravi
Copy link
Contributor

@semihcanturk a fix has been landed in master so please try again with the latest version of the repo. If you still experience problems feel free to reopen this issue.

@sinanmut
Copy link

I don't have any errors any more, thanks a lot!

@semihcanturk
Copy link
Author

I'm afraid the issue persists on my end. Reinstalled the latest master via pip3 install git+https://github.com/facebookresearch/pytorch3d.git, and the error is very much the same, except the last section:

ImportError: dlopen(/Users/semo/PycharmProjects/pytorch3d/pytorch3d/_C.cpython-37m-darwin.so, 2): Symbol not found: __Z23RasterizeMeshesFineCudaRKN2at6TensorES2_ifiib
  Referenced from: /Users/semo/PycharmProjects/pytorch3d/pytorch3d/_C.cpython-37m-darwin.so
  Expected in: flat namespace
 in /Users/semo/PycharmProjects/pytorch3d/pytorch3d/_C.cpython-37m-darwin.so

has been replaced by this simpler message:
ImportError: cannot import name '_C' from 'pytorch3d' (/Users/semo/PycharmProjects/pytorch3d/pytorch3d/__init__.py)

Can you reopen the issue? Thanks!

@nikhilaravi
Copy link
Contributor

@semihcanturk can you try doing import torch before importing pytorch3d?

@nikhilaravi nikhilaravi reopened this Feb 10, 2020
@nikhilaravi nikhilaravi added the bug Something isn't working label Feb 10, 2020
@semihcanturk
Copy link
Author

That is how it is right now. I also tried moving import torch to a cell above the one that imports pytorch3d and ran the cells sequentially, but neither case worked.

@nikhilaravi
Copy link
Contributor

@semihcanturk it seems PyTorch3D was not installed properly. Did you try pip uninstall and reinstalling?

@semihcanturk
Copy link
Author

yup. tried uninstall/installing both the default pip install pytorch3d (v 0.0.1) and the latest master via pip install git+https://github.com/facebookresearch/pytorch3d.git (v 0.1), but the issue remains.

@semihcanturk
Copy link
Author

semihcanturk commented Feb 10, 2020

oh, my apologies - I think the issue arose from the cloned repo (where the tutorials are) rather than the installed pytorch3d package. It seems to be resolved now that I ran python3 setup.py build develop on the repository root.

I have, however, encountered a new one in RuntimeError: Not implemented on the CPU. Will file it under a separate issue though as it is not directly related to the one in the title.

@nikhilaravi
Copy link
Contributor

ok great! I will close this issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants