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

UserWarning: cannot import name '_C' from 'sam2' #62

Closed
laisimiao opened this issue Dec 4, 2024 · 3 comments
Closed

UserWarning: cannot import name '_C' from 'sam2' #62

laisimiao opened this issue Dec 4, 2024 · 3 comments

Comments

@laisimiao
Copy link

/home/xxx/PycharmProjects/samurai/sam2/sam2/sam2_video_predictor.py:961: UserWarning: cannot import name '_C' from 'sam2' (/home/xxx/PycharmProjects/samurai/sam2/sam2/__init__.py)

Skipping the post-processing step due to the error above. You can still use SAM 2 and it's OK to ignore the error above, although some post-processing functionality may be limited (which doesn't affect the results in most cases; see https://github.com/facebookresearch/sam2/blob/main/INSTALL.md).

What operations are included in the post-processing process? Why we can ignore the error above?

@zhyjiang
Copy link
Collaborator

zhyjiang commented Dec 4, 2024

This is an error in the original SAM2 lib. You may check this issue: facebookresearch/sam2#25

@havinggood
Copy link

这是原始 SAM2 库中的错误。你可以检查这个问题: facebookresearch/sam2#25

I'm having the same problem with my torch is 2.3.1,cuda12.1,Run the solution in issue25:python setup.py build_ext --inplace Report an error:
CUDA_HOME environment variable is not set. Please set it to your CUDA install root.

Failed to build the SAM 2 CUDA extension due to the error above. You can still use SAM 2 and it's OK to ignore the error above, although some post-processing functionality may be limited (which doesn't affect the results in most cases; (see https://github.com/facebookresearch/sam2/blob/main/INSTALL.md).

@yangchris11
Copy link
Owner

@havinggood Our code base did not modify any cuda-related code nor require any further version of torch. We recommend you to first set-up the original SAM 2 environment and run a quick test to ensure the enviroment is set up correctly.

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

No branches or pull requests

4 participants