Stability-AI / stablediffusion

High-Resolution Image Synthesis with Latent Diffusion Models
MIT License
38.33k stars 4.95k forks source link

huggingface_hub.utils._errors.LocalEntryNotFoundError: Connection error #313

Open shihzenq opened 1 year ago

shihzenq commented 1 year ago

When the picture is generated, Run python scripts/txt2img.py --prompt "Generate a monster" --outdir output --device cuda --ckpt stable-diffusion-2-1/v2-1_768-ema-pruned.ckpt --config configs/stable-diffusion/v2-inference-v.yaml --H 768 --W 768.

error: Traceback (most recent call last): File "scripts/txt2img.py", line 388, in main(opt) File "scripts/txt2img.py", line 219, in main model = load_model_from_config(config, f"{opt.ckpt}", device) File "scripts/txt2img.py", line 34, in load_model_from_config model = instantiate_from_config(config.model) File "/home/stablediffusion/ldm/util.py", line 89, in instantiate_from_config return get_obj_from_str(config["target"])(config.get("params", dict())) File "/home/stablediffusion/ldm/models/diffusion/ddpm.py", line 563, in init self.instantiate_cond_stage(cond_stage_config) File "/home/stablediffusion/ldm/models/diffusion/ddpm.py", line 630, in instantiate_cond_stage model = instantiate_from_config(config) File "/home/stablediffusion/ldm/util.py", line 89, in instantiate_from_config return get_obj_from_str(config["target"])(config.get("params", dict())) File "/home/stablediffusion/ldm/modules/encoders/modules.py", line 190, in init model, , = open_clip.create_model_and_transforms(arch, device=torch.device('cpu'), pretrained=version) File "/home/tushen/anaconda3/envs/stablediffusion/lib/python3.8/site-packages/open_clip/factory.py", line 197, in create_model_and_transforms model = create_model( File "/home/tushen/anaconda3/envs/stablediffusion/lib/python3.8/site-packages/open_clip/factory.py", line 156, in create_model checkpoint_path = download_pretrained(pretrained_cfg, cache_dir=cache_dir) File "/home/tushen/anaconda3/envs/stablediffusion/lib/python3.8/site-packages/open_clip/pretrained.py", line 312, in download_pretrained target = download_pretrained_from_hf(model_id, cache_dir=cache_dir) File "/home/tushen/anaconda3/envs/stablediffusion/lib/python3.8/site-packages/open_clip/pretrained.py", line 282, in download_pretrained_from_hf cached_file = hf_hub_download(model_id, filename, revision=revision, cache_dir=cache_dir) File "/home/tushen/anaconda3/envs/stablediffusion/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/home/tushen/anaconda3/envs/stablediffusion/lib/python3.8/site-packages/huggingface_hub/file_download.py", line 1291, in hf_hub_download raise LocalEntryNotFoundError( huggingface_hub.utils._errors.LocalEntryNotFoundError: Connection error, and we cannot find the requested files in the disk cache. Please try again or make sure your Internet connection is on.

JiaTong1611 commented 12 months ago

Have you solved this problem? I encountered the same question

bhanuj10 commented 11 months ago

its seem like you have a internet network issue

try it with a proper connection or use a vpn because some service might have been blocked in your location

XiaoZong0 commented 9 months ago

I have encountered the same problem. have you fixed it?

bhanuj10 commented 9 months ago

Need more info about the internet connection Sometimes deleting the .cache might give a hand Try to use a stable network i prefer the cable ethernet