Skip to content
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

_C.so: undefined symbol #22

Closed
leviome opened this issue Jul 30, 2024 · 13 comments
Closed

_C.so: undefined symbol #22

leviome opened this issue Jul 30, 2024 · 13 comments

Comments

@leviome
Copy link

leviome commented Jul 30, 2024

THANKS FOR SAM2

from sam2 import _C
ImportError: /data/levi/segment-anything-2/sam2/_C.so: undefined symbol: _ZN3c1015SmallVectorBaseIjE8grow_podEPKvmm

pls tell me how to solve it.

@sarsmlee
Copy link

sarsmlee commented Jul 30, 2024

same problem
my env:
ub22.04
python3.11
pytorch2.3.1&pytorch2.4.0
cuda11.8&12.1 same problem

@leviome
Copy link
Author

leviome commented Jul 30, 2024

same problem my env: ub22.04 python3.11 pytorch2.3.1&pytorch2.4.0 cuda11.8&12.1 same problem

I'm trying solutions in #14 to downgrade pytorch to 2.1.0.

@sarsmlee
Copy link

sarsmlee commented Jul 30, 2024

same problem my env: ub22.04 python3.11 pytorch2.3.1&pytorch2.4.0 cuda11.8&12.1 same problem

I'm trying solutions in #14 to downgrade pytorch to 2.1.0.

but in setup.py, the pytorch version must be >=2.3.1.
ok it might be a error

@fangli333
Copy link

same problem my env: ub22.04 python3.11 pytorch2.3.1&pytorch2.4.0 cuda11.8&12.1 same problem

I'm trying solutions in #14 to downgrade pytorch to 2.1.0.

did you succeed? how did you do that? Thank you.

@ZlodeiBaal
Copy link

Same issue. Tried to downgrade to 2.1.0 - did not help

@gijskoning
Copy link

It was solved for me after running: python setup.py build_ext --inplace

@whcpumpkin
Copy link

It was solved for me after running: python setup.py build_ext --inplace

Me too. GPT-4 told me to run this command. It solved.

@leviome
Copy link
Author

leviome commented Jul 30, 2024

same problem my env: ub22.04 python3.11 pytorch2.3.1&pytorch2.4.0 cuda11.8&12.1 same problem

I'm trying solutions in #14 to downgrade pytorch to 2.1.0.

did you succeed? how did you do that? Thank you.

Yep, it worked.

@leviome
Copy link
Author

leviome commented Jul 30, 2024

It was solved for me after running: python setup.py build_ext --inplace

this seems like a nicer solution than downgrading pytorch.

@yoobin-jeong
Copy link

I still have the issue even after python setup.py build_ext --inplace
is there any other way?

@yoobin-jeong
Copy link

yoobin-jeong commented Jul 31, 2024

I still have the issue even after python setup.py build_ext --inplace is there any other way?

python setup.py clean --all then python setup.py build_ext --inplace works for me

@wRossw
Copy link

wRossw commented Aug 3, 2024

Worked for me too. For anyone using Colab ran the following

import os

# Change directory to your project folder
project_dir = 'your_path'
os.chdir(project_dir)

# Remove the build directory if it exists
!rm -rf build

# Build the extension
!python setup.py build_ext --inplace

@ArmandAlbert
Copy link

It was solved for me after running: python setup.py build_ext --inplace

This works! I found that the install file setup.py needs this command, or some packages are not installed correctly. Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants