XPixelGroup / DiffBIR

Official codes of DiffBIR: Towards Blind Image Restoration with Generative Diffusion Prior
Apache License 2.0
3.32k stars 282 forks source link

Model downloading problems: HuggingFace connection error #45

Open bjlybjb opened 1 year ago

bjlybjb commented 1 year ago

When I tried to inference,this error happened.I don‘t know how to solve this problem.

huggingface hub.utils.errors .LocalEntryNotFoundError: An error happened while trying to locate the file on the Hub and we cannot find the requested files in the local cache. please check your connection and try again or make sure your Internet connection is on.

nathubs commented 1 year ago

the same to me

ziyannchen commented 1 year ago

This seems a HuggingFace connection error. The script downloads pre-trained models from HuggingFace automatically. Try visiting HuggingFace and see if you can access it. If you are working on a remote server, an alternative is to download the target model to a local device and then upload it to the server.

bjlybjb commented 1 year ago

This seems a HuggingFace connection error. The script downloads pre-trained models from HuggingFace automatically. Try visiting HuggingFace and see if you can access it. If you are working on a remote server, an alternative is to download the target model to a local device and then upload it to the server.

Thanks for replying to my question. I did run it on a remote server. Now I tried to download the target model manually and then successfully solved the problem. Thank you very much!

0x3f3f3f3fun commented 1 year ago

@bjlybjb Hello! Could you please share which target models you have downloaded? If you can provide URLs, that would be even better. I believe most Chinese users will encounter this issue.

bjlybjb commented 1 year ago

@bjlybjb Hello! Could you please share which target models you have downloaded? If you can provide URLs, that would be even better. I believe most Chinese users will encounter this issue.

24wenjie-li commented 1 year ago

This seems a HuggingFace connection error. The script downloads pre-trained models from HuggingFace automatically. Try visiting HuggingFace and see if you can access it. If you are working on a remote server, an alternative is to download the target model to a local device and then upload it to the server.

Can you tell me the location of the folder to upload the downloaded files to?

24wenjie-li commented 1 year ago

这似乎是一个拥抱脸连接错误。该脚本会自动从HuggingFace下载预先训练的模型。尝试访问HuggingFace,看看是否可以访问它。如果您在远程服务器上工作,另一种方法是将目标模型下载到本地设备,然后将其上传到服务器。

感谢您回复我的问题。我确实在远程服务器上运行了它。现在我尝试手动下载目标模型,然后成功解决问题。谢谢!

Can you tell me to which folder to upload the downloaded file? How do I change the parameter in line 144?

bjlybjb commented 1 year ago

这似乎是一个拥抱脸连接错误。该脚本会自动从HuggingFace下载预先训练的模型。尝试访问HuggingFace,看看是否可以访问它。如果您在远程服务器上工作,另一种方法是将目标模型下载到本地设备,然后将其上传到服务器。

感谢您回复我的问题。我确实在远程服务器上运行了它。现在我尝试手动下载目标模型,然后成功解决问题。谢谢!

Can you tell me to which folder to upload the downloaded file? How do I change the parameter in line 144?

Change the parameter “version” to the path where you upload. You can upload the file to everywhere you want.

24wenjie-li commented 1 year ago

这似乎是一个拥抱脸连接错误。该脚本会自动从HuggingFace下载预先训练的模型。尝试访问HuggingFace,看看是否可以访问它。如果您在远程服务器上工作,另一种方法是将目标模型下载到本地设备,然后将其上传到服务器。

感谢您回复我的问题。我确实在远程服务器上运行了它。现在我尝试手动下载目标模型,然后成功解决问题。谢谢!

Can you tell me to which folder to upload the downloaded file? How do I change the parameter in line 144?

Change the parameter “version” to the path where you upload. You can upload the file to everywhere you want.

Thank you!

wuxiaoxue1006 commented 1 year ago

@bjlybjb Hello, I used your method but reported this error, may I ask you have encountered this error? RuntimeError: PytorchStreamReader failed reading zip archive: invalid header or archive is corrupted

iruhh commented 1 year ago

These links may be helpful. https://github.com/mlfoundations/open_clip/issues/622 https://github.com/mlfoundations/open_clip/issues/528

wiqe1314 commented 1 year ago

这似乎是一个拥抱脸连接错误。该脚本会自动从HuggingFace下载预先训练的模型。尝试访问HuggingFace,看看是否可以访问它。如果您在远程服务器上工作,另一种方法是将目标模型下载到本地设备,然后将其上传到服务器。

感谢您回复我的问题。我确实在远程服务器上运行了它。现在我尝试手动下载目标模型,然后成功解决问题。谢谢!

Can you tell me to which folder to upload the downloaded file? How do I change the parameter in line 144?

Change the parameter “version” to the path where you upload. You can upload the file to everywhere you want.

Thank you!

我能看一下你修改后的144行代码吗?

wiqe1314 commented 12 months ago

@bjlybjb你好!你能分享一下你下载的目标型号吗?如果你能提供URL,那就更好了。我相信大多数中国用户会遇到这个问题。

@bjlybjb Hello! Could you please share which target models you have downloaded? If you can provide URLs, that would be even better. I believe most Chinese users will encounter this issue.

  • https://huggingface.co/laion/CLIP-ViT-H-14-laion2B-s32B-b79K/tree/main I have downloaded open_clip_pytorch_model.bin. And then I found the file “~/DiffBIR-main/ldm/modules/encoders/modules.py” according to traceback and changed the parameter in line 144. I‘m not sure whether it is absolutely correct. But at least the error never occur again.

@bjlybjb I am a beginner in programming and tried to deploy Diffbir on my home win platform. I also encountered the problem that huggingface could not connect when starting.I tried to download the model locally, but I don't know how to apply it and where should it be stored? How should line 144 in the /modules.py file you mentioned be modified? I am a newbie, can you provide a modified code of line 144 for reference?

catsled commented 11 months ago

@bjlybjb你好!你能分享一下你下载的目标型号吗?如果你能提供URL,那就更好了。我相信大多数中国用户会遇到这个问题。

@bjlybjb Hello! Could you please share which target models you have downloaded? If you can provide URLs, that would be even better. I believe most Chinese users will encounter this issue.

  • https://huggingface.co/laion/CLIP-ViT-H-14-laion2B-s32B-b79K/tree/main I have downloaded open_clip_pytorch_model.bin. And then I found the file “~/DiffBIR-main/ldm/modules/encoders/modules.py” according to traceback and changed the parameter in line 144. I‘m not sure whether it is absolutely correct. But at least the error never occur again.

@bjlybjb I am a beginner in programming and tried to deploy Diffbir on my home win platform. I also encountered the problem that huggingface could not connect when starting.I tried to download the model locally, but I don't know how to apply it and where should it be stored? How should line 144 in the /modules.py file you mentioned be modified? I am a newbie, can you provide a modified code of line 144 for reference?

image
ziyannchen commented 11 months ago

Hey guys, all the related model should be downloaded automatically if you can access huggingface website.

However, if you stuck in huggingface model downloading for the server's internet aceess problem or you require to run the model offline, etc., any model-downloading problems, please refer to the following checklist for manually model downloading guidance.

Model downloading checklist:

(Here we provide all huggingface download links for DiffBIR models, in case of problems like internet access, you can also check the README for other servers BaiduCloud and OpenXLab for downloading as well)

Duplicate with #81 .

wiqe1314 commented 11 months ago

Hey guys, all the related model should be downloaded automatically if you can access huggingface website.

However, if you stuck in huggingface model downloading for the server's internet aceess problem or you require to run the model offline, etc., any model-downloading problems, please refer to the following checklist for manually model downloading guidance.

Model downloading checklist:

  • download open_clip_pytorch_model.bin to directory ~/.cache/huggingface/hub/ (this is consistant to the automatic script downloaing path, you can assign any other paths), then add a line of your clip model path into the config file configs/model/cldm.yaml as
84 cond_stage_config:
85    target: ldm.modules.encoders.modules.FrozenOpenCLIPEmbedder
86    params:
+       version: "${HOME}/.cache/huggingface/hub/open_clip_pytorch_model.bin"
87      freeze: True
88      layer: "penultimate"

(Here we provide all huggingface download links for DiffBIR models, in case of problems like internet access, you can also check the README for other servers BaiduCloud and OpenXLab for downloading as well)

Duplicate with #81 .

thank you!

wiqe1314 commented 11 months ago

Hey guys, all the related model should be downloaded automatically if you can access huggingface website. However, if you stuck in huggingface model downloading for the server's internet aceess problem or you require to run the model offline, etc., any model-downloading problems, please refer to the following checklist for manually model downloading guidance. Model downloading checklist:

  • download open_clip_pytorch_model.bin to directory ~/.cache/huggingface/hub/ (this is consistant to the automatic script downloaing path, you can assign any other paths), then add a line of your clip model path into the config file configs/model/cldm.yaml as
84 cond_stage_config:
85    target: ldm.modules.encoders.modules.FrozenOpenCLIPEmbedder
86    params:
+       version: "${HOME}/.cache/huggingface/hub/open_clip_pytorch_model.bin"
87      freeze: True
88      layer: "penultimate"

(Here we provide all huggingface download links for DiffBIR models, in case of problems like internet access, you can also check the README for other servers BaiduCloud and OpenXLab for downloading as well) Duplicate with #81 .

thank you! I have successfully run

baiguiang commented 7 months ago

Hey guys, all the related model should be downloaded automatically if you can access huggingface website.

However, if you stuck in huggingface model downloading for the server's internet aceess problem or you require to run the model offline, etc., any model-downloading problems, please refer to the following checklist for manually model downloading guidance.

Model downloading checklist:

  • download open_clip_pytorch_model.bin to directory ~/.cache/huggingface/hub/ (this is consistant to the automatic script downloaing path, you can assign any other paths), then add a line of your clip model path into the config file configs/model/cldm.yaml as
84 cond_stage_config:
85    target: ldm.modules.encoders.modules.FrozenOpenCLIPEmbedder
86    params:
+       version: "${HOME}/.cache/huggingface/hub/open_clip_pytorch_model.bin"
87      freeze: True
88      layer: "penultimate"

(Here we provide all huggingface download links for DiffBIR models, in case of problems like internet access, you can also check the README for other servers BaiduCloud and OpenXLab for downloading as well)

Duplicate with #81 .

hi,首先谢谢您的解答,我按照您的方式去解决这个问题,但是仍然报错 RuntimeError: Pretrained weights ($/home/hjt/下载/wy/DiffBIR-main/.cache/huggingface/hub/open_clip_pytorch_model.bin) not found for model ViT-H-14. Available pretrained tags (['laion2b_s32b_b79k']. 您可以帮忙解答吗,谢谢。

ziyannchen commented 7 months ago

hi,首先谢谢您的解答,我按照您的方式去解决这个问题,但是仍然报错 RuntimeError: Pretrained weights ($/home/hjt/下载/wy/DiffBIR-main/.cache/huggingface/hub/open_clip_pytorch_model.bin) not found for model ViT-H-14. Available pretrained tags (['laion2b_s32b_b79k']. 您可以帮忙解答吗,谢谢。

看起来是CLIP模型文件没有下载成功,可以试着重新下载一下

baiguiang commented 7 months ago

hi,首先谢谢您的解答,我按照您的方式去解决这个问题,但是仍然报错 RuntimeError: Pretrained weights ($/home/hjt/下载/wy/DiffBIR-main/.cache/huggingface/hub/open_clip_pytorch_model.bin) not found for model ViT-H-14. Available pretrained tags (['laion2b_s32b_b79k']. 您可以帮忙解答吗,谢谢。

看起来是CLIP模型文件没有下载成功,可以试着重新下载一下

谢谢回复,但我尝试了重新下载这个文件,仍然是同样的错误,我是从镜像网站下载的,这会有影响吗?

ziyannchen commented 7 months ago

hi,首先谢谢您的解答,我按照您的方式去解决这个问题,但是仍然报错 RuntimeError: Pretrained weights ($/home/hjt/下载/wy/DiffBIR-main/.cache/huggingface/hub/open_clip_pytorch_model.bin) not found for model ViT-H-14. Available pretrained tags (['laion2b_s32b_b79k']. 您可以帮忙解答吗,谢谢。

看起来是CLIP模型文件没有下载成功,可以试着重新下载一下

谢谢回复,但我尝试了重新下载这个文件,仍然是同样的错误,我是从镜像网站下载的,这会有影响吗?

应该没有影响。不过看起来你的路径“$/home/hjt/下载/”似乎有点问题,可以检查一下。