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

sam2 image ml backend installation error #669

Open
Thomas-J-Kidd opened this issue Nov 19, 2024 · 1 comment
Open

sam2 image ml backend installation error #669

Thomas-J-Kidd opened this issue Nov 19, 2024 · 1 comment

Comments

@Thomas-J-Kidd
Copy link

Is anyone else getting an issue when trying to set up sam2 image ml backend?
I get this after I modify model.py to match my checkpoints and other environmental variables.

(test-environment) % label-studio-ml start ./segment_anything_2_image 
Traceback (most recent call last):
  File "/media/***/sam-2-test-v2/label-studio-ml-backend/label_studio_ml/examples/././segment_anything_2_image/_wsgi.py", line 33, in <module>
    from model import NewModel
  File "/media/***/sam-2-test-v2/label-studio-ml-backend/label_studio_ml/examples/segment_anything_2_image/model.py", line 12, in <module>
    from sam2.build_sam import build_sam2
  File "/media/***/sam-2-test-v2/label-studio-ml-backend/label_studio_ml/examples/segment_anything_2_image/sam2/sam2/build_sam.py", line 25, in <module>
    raise RuntimeError(
RuntimeError: You're likely running Python from the parent directory of the sam2 repository (i.e. the directory where https://github.com/facebookresearch/sam2 is cloned into). This is not supported since the `sam2` Python package could be shadowed by the repository name (the repository is also named `sam2` and contains the Python package in `sam2/sam2`). Please run Python from another directory (e.g. from the repo dir rather than its parent dir, or from your home directory) after installing SAM 2.
@jguo1002
Copy link

Rename sam2 directory (the one you git cloned) to segment-anything-2.

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

2 participants