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

MobileSAM Entry Not Found #54

Open
Profy opened this issue Aug 9, 2024 · 2 comments
Open

MobileSAM Entry Not Found #54

Profy opened this issue Aug 9, 2024 · 2 comments

Comments

@Profy
Copy link

Profy commented Aug 9, 2024

MobileSAM download in the controlnet_union_test_segment.py script does not work. It can't find the entry point.

Traceback (most recent call last):
  File "/home/user/.local/lib/python3.10/site-packages/huggingface_hub/utils/_errors.py", line 304, in hf_raise_for_status
    response.raise_for_status()
  File "/home/user/.local/lib/python3.10/site-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://huggingface.co/dhkim2810/MobileSAM/resolve/main/sam_vit_h_4b8939.pth

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/user/ControlNetPlus/controlnet_union_test_segment.py", line 42, in <module>
    processor = SamDetector.from_pretrained('dhkim2810/MobileSAM').to(device)
  File "/home/user/.local/lib/python3.10/site-packages/controlnet_aux/segment_anything/__init__.py", line 35, in from_pretrained
    model_path = hf_hub_download(pretrained_model_or_path, filename, subfolder=subfolder, cache_dir=cache_dir)
  File "/home/user/.local/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py", line 119, in _inner_fn
    return fn(*args, **kwargs)
  File "/home/user/.local/lib/python3.10/site-packages/huggingface_hub/file_download.py", line 1261, in hf_hub_download
    metadata = get_hf_file_metadata(
  File "/home/user/.local/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py", line 119, in _inner_fn
    return fn(*args, **kwargs)
  File "/home/user/.local/lib/python3.10/site-packages/huggingface_hub/file_download.py", line 1674, in get_hf_file_metadata
    r = _request_wrapper(
  File "/home/user/.local/lib/python3.10/site-packages/huggingface_hub/file_download.py", line 369, in _request_wrapper
    response = _request_wrapper(
  File "/home/user/.local/lib/python3.10/site-packages/huggingface_hub/file_download.py", line 393, in _request_wrapper
    hf_raise_for_status(response)
  File "/home/user/.local/lib/python3.10/site-packages/huggingface_hub/utils/_errors.py", line 315, in hf_raise_for_status
    raise EntryNotFoundError(message, response) from e
huggingface_hub.utils._errors.EntryNotFoundError: 404 Client Error. (Request ID: Root=1-66b5d46f-2cece28e44cd3ba2052fed2c;a31fcc4e-c4bb-4b8b-adc0-1b7a6d1cff89)

Entry Not Found for url: https://huggingface.co/dhkim2810/MobileSAM/resolve/main/sam_vit_h_4b8939.pth.

Is there an additional step (such as adding weights locally or using a token for downloading) required to download MobileSAM?

@tttonyalpha
Copy link

Try to use SamDetector.from_pretrained("dhkim2810/MobileSAM", model_type="vit_t", filename="mobile_sam.pt")

@aycaecemgul
Copy link

aycaecemgul commented Nov 1, 2024

Try to use SamDetector.from_pretrained("dhkim2810/MobileSAM", model_type="vit_t", filename="mobile_sam.pt")

I tried this but i got another error:
RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu!
I am using controlnet-aux==0.0.9

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

3 participants