TencentARC / InstantMesh

InstantMesh: Efficient 3D Mesh Generation from a Single Image with Sparse-view Large Reconstruction Models
Apache License 2.0
3.27k stars 349 forks source link

cached_download no longer exists on hugging face #169

Open jacksonkr opened 1 week ago

jacksonkr commented 1 week ago
$ python run.py configs/instant-mesh-large.yaml examples/hatsune_miku.png --save_video --no_rembg
Traceback (most recent call last):
  File "/mnt/c/Users/Jackson/Documents/git/InstantMesh/run.py", line 13, in <module>
    from diffusers import DiffusionPipeline, EulerAncestralDiscreteScheduler
  File "/home/jackson/.local/lib/python3.10/site-packages/diffusers/__init__.py", line 3, in <module>
    from .configuration_utils import ConfigMixin
  File "/home/jackson/.local/lib/python3.10/site-packages/diffusers/configuration_utils.py", line 34, in <module>
    from .utils import (
  File "/home/jackson/.local/lib/python3.10/site-packages/diffusers/utils/__init__.py", line 37, in <module>
    from .dynamic_modules_utils import get_class_from_dynamic_module
  File "/home/jackson/.local/lib/python3.10/site-packages/diffusers/utils/dynamic_modules_utils.py", line 28, in <module>
    from huggingface_hub import HfFolder, cached_download, hf_hub_download, model_info
ImportError: cannot import name 'cached_download' from 'huggingface_hub' (/home/jackson/.local/lib/python3.10/site-packages/huggingface_hub/__init__.py)

I ran into the same issue with another repo. Apparently cached_download was removed in hugginface 0.26 as per https://github.com/huggingface/huggingface_hub/issues/2617

ciscogeek commented 5 days ago

same issue. use 0.25.2 instead.

pip install --upgrade huggingface_hub==0.25.2

bluestyle97 commented 5 days ago

I tested on my own environment and found that simply upgraging all the related packages can solve the problem:

pip install --upgrade huggingface-hub==0.26.2 transformers==4.46.1 tokenizers==0.20.1 diffusers==0.31.0
jacksonkr commented 5 days ago

On both 0.25.2 and 0.26.2 (I tried both suggestions) I'm still left with similar output ending in

Repository Not Found for url: https://huggingface.co/api/models/cached_download/revision/main.
Please make sure you specified the correct `repo_id` and `repo_type`.
If you are trying to access a private or gated repo, make sure you are authenticated.
Invalid username or password.

If I'm not mistaken, cached_download has been entirely removed from huggingface regardless of cli version.

Aplegas commented 2 days ago

Hi, everyone just locate the "cached_download" import in the module "dynamic_modules_utils.py" and remove it. I think it was left there by mistake because it was imported by never used. Also you might need to install the following: pip install "jax[cuda12_local]==0.4.23" -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html according to: stackoverflow.