Algolzw / daclip-uir

[ICLR 2024] Controlling Vision-Language Models for Universal Image Restoration. 5th place in the NTIRE 2024 Restore Any Image Model in the Wild Challenge.
https://algolzw.github.io/daclip-uir
MIT License
669 stars 34 forks source link

generate_captions.py errors! #79

Open hongsheng-Z opened 1 month ago

hongsheng-Z commented 1 month ago

Thanks for your excellent work. When I run your code I get the following error : File "/mnt/data/anaconda3/lib/python3.9/site-packages/clip_interrogator/clip_interrogator.py", line 85, in load_caption_model caption_model = BlipForConditionalGeneration.from_pretrained(model_path, torch_dtype=self.dtype) OSError: We couldn't connect to 'https://huggingface.co' to load this file, couldn't find it in the cached files and it looks like Salesforce/blip-image-captioning-large is not the path to a directory containing a file named config.json. Checkout your internet connection or see how to run the library in offline mode at 'https://huggingface.co/docs/transformers/installation#offline-mode'.

This should be a problem with my network. I tried to load the model manually, but I couldn't find a download link for the pre-trained Salesforce/blip-image-captioning-large model at huggingface.

Algolzw commented 1 month ago

Hi, you can try to clone the BLIP repository with their provided models via: https://huggingface.co/Salesforce/blip-image-captioning-large?clone=true.

hongsheng-Z commented 1 month ago

Is it downloading the whole blip-image-captioning-large project locally and then loading it manually? Thanks for your help!

hongsheng-Z commented 1 month ago

Is it downloading the whole blip-image-captioning-large project locally and then loading it manually? Thanks for your help!

Thanks, I have solved this problem.