open_clip
open_clip copied to clipboard
This machine is not connected to the Internet, how to adapt the code to prevent the pre-model from being downloaded online.
do: model, _, _ = open_clip.create_model_and_transforms("ViT-H-14", device="cpu", pretrained="laion2b_s32b_b79k", cache_dir="/data/work/StableSR-main/") error: urllib3.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1125)
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/opt/conda/lib/python3.8/site-packages/requests/adapters.py", line 439, in send resp = conn.urlopen( File "/opt/conda/lib/python3.8/site-packages/urllib3/connectionpool.py", line 844, in urlopen retries = retries.increment( File "/opt/conda/lib/python3.8/site-packages/urllib3/util/retry.py", line 515, in increment raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /laion/CLIP-ViT-H-14-laion2B-s32B-b79K/resolve/main/open_clip_pytorch_model.bin (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1125)')))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "
To download the model in the installation environment, the code must first access the network to know the specific path of the model. So do we also need to connect our local models to the internet?
And I have downloaded the relevant models locally, but the code still needs to try to access the network
open_clip/factory.py:113~115 lines I suggest that the logical order of the code should be changed.
hi have you solved the problem?
any updates?
any updates?
Hi all. Probably the simplest thing to do here is to manually download the checkpoint and then point to the checkpoint itself when loading the model (see https://github.com/mlfoundations/open_clip/#loading-models). If that doesn't work for you let me know and I'll look more into it