Openai large model CLIP installation failure solution

introduction

Open AI released Contrastive Language-Image Pre-training (CLIP) in January 2021, a multi-modal model based on contrastive text-image comparison learning. Through contrastive learning of images and their corresponding text descriptions, the model can learn text- Matching relationship of image pairs. It is open source, multimodal, zero-shot, few-shot, and supervised training.
 

1 Problem description

Install the CLIP model of openai by the following command

pip install git+https://github.com/openai/CLIP.git

Multiple installations have failed, and the error message is as follows:

[root@localhost opt]# pip install git+https://github.com/openai/CLIP.git
Looking in indexes: https://pypi.doubanio.com/simple/
Collecting git+https://github.com/openai/CLIP.git
  Cloning https://github.com/openai/CLIP.git to /tmp/pip-req-build-swwjmtjb
  Running command git clone --filter=blob:none --quiet https://github.com/openai/CLIP.git /tmp/pip-req-build-swwjmtjb
  致命错误:无法访问 'https://github.com/openai/CLIP.git/':Encountered end of file
  致命错误:无法从承诺者远程获取 570a54198bb0d012a585c3999d5281c07cd339e9
  警告:克隆成功,但是检出失败。
  您可以通过 'git status' 检查哪些已被检出,然后使用命令
  'git restore --source=HEAD :/' 重试

  error: subprocess-exited-with-error
  
  × git clone --filter=blob:none --quiet https://github.com/openai/CLIP.git /tmp/pip-req-build-swwjmtjb did not run successfully.
  │ exit code: 128
  ╰─> See above for output.
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× git clone --filter=blob:none --quiet https://github.com/openai/CLIP.git /tmp/pip-req-build-swwjmtjb did not run successfully.
│ exit code: 128
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.


[root@localhost opt]# pip install git+https://github.com/openai/CLIP.git
Looking in indexes: https://pypi.doubanio.com/simple/
Collecting git+https://github.com/openai/CLIP.git
  Cloning https://github.com/openai/CLIP.git to /tmp/pip-req-build-8hoyi_ld
  Running command git clone --filter=blob:none --quiet https://github.com/openai/CLIP.git /tmp/pip-req-build-8hoyi_ld
  致命错误:无法访问 'https://github.com/openai/CLIP.git/':Encountered end of file
  error: subprocess-exited-with-error
  
  × git clone --filter=blob:none --quiet https://github.com/openai/CLIP.git /tmp/pip-req-build-8hoyi_ld did not run successfully.
  │ exit code: 128
  ╰─> See above for output.
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× git clone --filter=blob:none --quiet https://github.com/openai/CLIP.git /tmp/pip-req-build-8hoyi_ld did not run successfully.
│ exit code: 128
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

2 Problem Analysis

致命错误:无法访问 'https://github.com/openai/CLIP.git/':Encountered end of file

It can be seen from the cause of the error that the CLIP model code cannot be downloaded due to network reasons, resulting in installation failure

3 problem solving

Enable the agent for installation, the command is as follows:

 [root@localhost opt]# pip install git+https://ghproxy.com/https://github.com/openai/CLIP.git

The installation process is displayed as follows:

 [root@localhost opt]# pip install git+https://ghproxy.com/https://github.com/openai/CLIP.git
Looking in indexes: https://pypi.doubanio.com/simple/
Collecting git+https://ghproxy.com/https://github.com/openai/CLIP.git
  Cloning https://ghproxy.com/https://github.com/openai/CLIP.git to /tmp/pip-req-build-xxbzmsfb
  Running command git clone --filter=blob:none --quiet https://ghproxy.com/https://github.com/openai/CLIP.git /tmp/pip-req-build-xxbzmsfb
  Resolved https://ghproxy.com/https://github.com/openai/CLIP.git to commit a1d071733d7111c9c014f024669f959182114e33
  Preparing metadata (setup.py) ... done
Requirement already satisfied: ftfy in /root/anaconda3/envs/patent/lib/python3.9/site-packages (from clip==1.0) (6.1.1)
Collecting regex (from clip==1.0)
  Downloading https://pypi.doubanio.com/packages/c6/86/f0bb334088b102e2bb3528b502d3c0c0a7301cbc2c8d2e0304ec4b1964d7/regex-2023.5.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (769 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 769.0/769.0 kB 1.3 MB/s eta 0:00:00
Collecting tqdm (from clip==1.0)
  Using cached https://pypi.doubanio.com/packages/e6/02/a2cff6306177ae6bc73bc0665065de51dfb3b9db7373e122e2735faf0d97/tqdm-4.65.0-py3-none-any.whl (77 kB)
Collecting torch (from clip==1.0)
  Using cached https://pypi.doubanio.com/packages/e5/9a/ce0fe125f226ffce8deba6a18bd8d0b9f589aa236780a83a6d70b5525f56/torch-2.0.1-cp39-cp39-manylinux1_x86_64.whl (619.9 MB)
Collecting torchvision (from clip==1.0)
  Downloading https://pypi.doubanio.com/packages/41/9e/8809e45a084680394e8d219fcf8a2c0eed2dddf1ec0a7968f4052826a6e9/torchvision-0.15.2-cp39-cp39-manylinux1_x86_64.whl (6.0 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 6.0/6.0 MB 1.2 MB/s eta 0:00:00
Requirement already satisfied: wcwidth>=0.2.5 in /root/anaconda3/envs/patent/lib/python3.9/site-packages (from ftfy->clip==1.0) (0.2.6)
Collecting filelock (from torch->clip==1.0)
  Using cached https://pypi.doubanio.com/packages/ad/73/b094a662ae05cdc4ec95bc54e434e307986a5de5960166b8161b7c1373ee/filelock-3.12.0-py3-none-any.whl (10 kB)
Collecting typing-extensions (from torch->clip==1.0)
  Using cached https://pypi.doubanio.com/packages/7e/4d/b0185d077dc1cd070a56859a0ba3bb6e76618393ec693e59faf1368da8f6/typing_extensions-4.7.0-py3-none-any.whl (33 kB)
Collecting sympy (from torch->clip==1.0)
  Using cached https://pypi.doubanio.com/packages/d2/05/e6600db80270777c4a64238a98d442f0fd07cc8915be2a1c16da7f2b9e74/sympy-1.12-py3-none-any.whl (5.7 MB)
Collecting networkx (from torch->clip==1.0)
  Downloading https://pypi.doubanio.com/packages/a8/05/9d4f9b78ead6b2661d6e8ea772e111fc4a9fbd866ad0c81906c11206b55e/networkx-3.1-py3-none-any.whl (2.1 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB 1.2 MB/s eta 0:00:00
Collecting jinja2 (from torch->clip==1.0)
  Downloading https://pypi.doubanio.com/packages/bc/c3/f068337a370801f372f2f8f6bad74a5c140f6fda3d9de154052708dd3c65/Jinja2-3.1.2-py3-none-any.whl (133 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 133.1/133.1 kB 1.9 MB/s eta 0:00:00
Collecting nvidia-cuda-nvrtc-cu11==11.7.99 (from torch->clip==1.0)
  Downloading https://pypi.doubanio.com/packages/ef/25/922c5996aada6611b79b53985af7999fc629aee1d5d001b6a22431e18fec/nvidia_cuda_nvrtc_cu11-11.7.99-2-py3-none-manylinux1_x86_64.whl (21.0 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 21.0/21.0 MB 1.1 MB/s eta 0:00:00
Collecting nvidia-cuda-runtime-cu11==11.7.99 (from torch->clip==1.0)
  Downloading https://pypi.doubanio.com/packages/36/92/89cf558b514125d2ebd8344dd2f0533404b416486ff681d5434a5832a019/nvidia_cuda_runtime_cu11-11.7.99-py3-none-manylinux1_x86_64.whl (849 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 849.3/849.3 kB 1.3 MB/s eta 0:00:00
Collecting nvidia-cuda-cupti-cu11==11.7.101 (from torch->clip==1.0)
  Downloading https://pypi.doubanio.com/packages/e6/9d/dd0cdcd800e642e3c82ee3b5987c751afd4f3fb9cc2752517f42c3bc6e49/nvidia_cuda_cupti_cu11-11.7.101-py3-none-manylinux1_x86_64.whl (11.8 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 11.8/11.8 MB 1.2 MB/s eta 0:00:00
Collecting nvidia-cudnn-cu11==8.5.0.96 (from torch->clip==1.0)
  Downloading https://pypi.doubanio.com/packages/dc/30/66d4347d6e864334da5bb1c7571305e501dcb11b9155971421bb7bb5315f/nvidia_cudnn_cu11-8.5.0.96-2-py3-none-manylinux1_x86_64.whl (557.1 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 557.1/557.1 MB 905.2 kB/s eta 0:00:00
Collecting nvidia-cublas-cu11==11.10.3.66 (from torch->clip==1.0)
  Downloading https://pypi.doubanio.com/packages/ce/41/fdeb62b5437996e841d83d7d2714ca75b886547ee8017ee2fe6ea409d983/nvidia_cublas_cu11-11.10.3.66-py3-none-manylinux1_x86_64.whl (317.1 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 317.1/317.1 MB 1.0 MB/s eta 0:00:00
Collecting nvidia-cufft-cu11==10.9.0.58 (from torch->clip==1.0)
  Downloading https://pypi.doubanio.com/packages/74/79/b912a77e38e41f15a0581a59f5c3548d1ddfdda3225936fb67c342719e7a/nvidia_cufft_cu11-10.9.0.58-py3-none-manylinux1_x86_64.whl (168.4 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 168.4/168.4 MB 1.1 MB/s eta 0:00:00
Collecting nvidia-curand-cu11==10.2.10.91 (from torch->clip==1.0)
  Downloading https://pypi.doubanio.com/packages/8f/11/af78d54b2420e64a4dd19e704f5bb69dcb5a6a3138b4465d6a48cdf59a21/nvidia_curand_cu11-10.2.10.91-py3-none-manylinux1_x86_64.whl (54.6 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 54.6/54.6 MB 1.2 MB/s eta 0:00:00
Collecting nvidia-cusolver-cu11==11.4.0.1 (from torch->clip==1.0)
  Downloading https://pypi.doubanio.com/packages/3e/77/66149e3153b19312fb782ea367f3f950123b93916a45538b573fe373570a/nvidia_cusolver_cu11-11.4.0.1-2-py3-none-manylinux1_x86_64.whl (102.6 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 102.6/102.6 MB 887.4 kB/s eta 0:00:00
Collecting nvidia-cusparse-cu11==11.7.4.91 (from torch->clip==1.0)
  Downloading https://pypi.doubanio.com/packages/ea/6f/6d032cc1bb7db88a989ddce3f4968419a7edeafda362847f42f614b1f845/nvidia_cusparse_cu11-11.7.4.91-py3-none-manylinux1_x86_64.whl (173.2 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 173.2/173.2 MB 1.0 MB/s eta 0:00:00
Collecting nvidia-nccl-cu11==2.14.3 (from torch->clip==1.0)
  Downloading https://pypi.doubanio.com/packages/55/92/914cdb650b6a5d1478f83148597a25e90ea37d739bd563c5096b0e8a5f43/nvidia_nccl_cu11-2.14.3-py3-none-manylinux1_x86_64.whl (177.1 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 177.1/177.1 MB 1.1 MB/s eta 0:00:00
Collecting nvidia-nvtx-cu11==11.7.91 (from torch->clip==1.0)
  Downloading https://pypi.doubanio.com/packages/23/d5/09493ff0e64fd77523afbbb075108f27a13790479efe86b9ffb4587671b5/nvidia_nvtx_cu11-11.7.91-py3-none-manylinux1_x86_64.whl (98 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 98.6/98.6 kB 917.4 kB/s eta 0:00:00
Collecting triton==2.0.0 (from torch->clip==1.0)
  Downloading https://pypi.doubanio.com/packages/77/ac/28b74ec1177c730d0da8803eaff5e5025bd532bcf07cadb0fcf661abed97/triton-2.0.0-1-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (63.3 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 63.3/63.3 MB 1.2 MB/s eta 0:00:00
Requirement already satisfied: setuptools in /root/anaconda3/envs/patent/lib/python3.9/site-packages (from nvidia-cublas-cu11==11.10.3.66->torch->clip==1.0) (68.0.0)
Requirement already satisfied: wheel in /root/anaconda3/envs/patent/lib/python3.9/site-packages (from nvidia-cublas-cu11==11.10.3.66->torch->clip==1.0) (0.38.4)
Collecting cmake (from triton==2.0.0->torch->clip==1.0)
  Downloading https://pypi.doubanio.com/packages/1d/de/48d485d12285cd53e322fb7bdb263778820984d4be54c2bb2fb5eced5e87/cmake-3.26.3-py2.py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (24.0 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 24.0/24.0 MB 1.2 MB/s eta 0:00:00
Collecting lit (from triton==2.0.0->torch->clip==1.0)
  Using cached lit-16.0.6-py3-none-any.whl
Collecting numpy (from torchvision->clip==1.0)
  Using cached https://pypi.doubanio.com/packages/69/1f/c95b1108a9972a52d7b1b63ed8ca70466b59b8c1811bd121f1e667cc45d8/numpy-1.25.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (18.3 MB)
Collecting requests (from torchvision->clip==1.0)
  Using cached https://pypi.doubanio.com/packages/70/8e/0e2d847013cb52cd35b38c009bb167a1a26b2ce6cd6965bf26b47bc0bf44/requests-2.31.0-py3-none-any.whl (62 kB)
Collecting pillow!=8.3.*,>=5.3.0 (from torchvision->clip==1.0)
  Downloading https://pypi.doubanio.com/packages/ff/fc/48a51c0fe2a00d5def57b9981a1e0f8339b516351da7a51500383d833bc8/Pillow-9.5.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.3 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.3/3.3 MB 1.2 MB/s eta 0:00:00
Collecting MarkupSafe>=2.0 (from jinja2->torch->clip==1.0)
  Using cached https://pypi.doubanio.com/packages/06/3b/d026c21cd1dbee89f41127e93113dcf5fa85c6660d108847760b59b3a66d/MarkupSafe-2.1.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (25 kB)
Collecting charset-normalizer<4,>=2 (from requests->torchvision->clip==1.0)
  Downloading https://pypi.doubanio.com/packages/33/97/9967fb2d364a9da38557e4af323abcd58cc05bdd8f77e9fd5ae4882772cc/charset_normalizer-3.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (199 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 199.2/199.2 kB 1.3 MB/s eta 0:00:00
Collecting idna<4,>=2.5 (from requests->torchvision->clip==1.0)
  Using cached https://pypi.doubanio.com/packages/fc/34/3030de6f1370931b9dbb4dad48f6ab1015ab1d32447850b9fc94e60097be/idna-3.4-py3-none-any.whl (61 kB)
Collecting urllib3<3,>=1.21.1 (from requests->torchvision->clip==1.0)
  Using cached https://pypi.doubanio.com/packages/8a/03/ad9306a50d05c166e3456fe810f33cee2b8b2a7a6818ec5d4908c4ec6b36/urllib3-2.0.3-py3-none-any.whl (123 kB)
Collecting certifi>=2017.4.17 (from requests->torchvision->clip==1.0)
  Downloading https://pypi.doubanio.com/packages/9d/19/59961b522e6757f0c9097e4493fa906031b95b3ebe9360b2c3083561a6b4/certifi-2023.5.7-py3-none-any.whl (156 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 157.0/157.0 kB 1.8 MB/s eta 0:00:00
Collecting mpmath>=0.19 (from sympy->torch->clip==1.0)
  Downloading https://pypi.doubanio.com/packages/43/e3/7d92a15f894aa0c9c4b49b8ee9ac9850d6e63b03c9c32c0367a13ae62209/mpmath-1.3.0-py3-none-any.whl (536 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 536.2/536.2 kB 1.2 MB/s eta 0:00:00
Building wheels for collected packages: clip
  Building wheel for clip (setup.py) ... done
  Created wheel for clip: filename=clip-1.0-py3-none-any.whl size=1369497 sha256=a2f30eacf484a795fa92e13eccbc18aed58ccd258c8e01726fbe256bb098d6b6
  Stored in directory: /tmp/pip-ephem-wheel-cache-i0mqjmor/wheels/40/3f/89/b772b7bb925532ea1f0ec1b0116bc52313d8d4695952d94103
Successfully built clip
Installing collected packages: mpmath, lit, cmake, urllib3, typing-extensions, tqdm, sympy, regex, pillow, nvidia-nvtx-cu11, nvidia-nccl-cu11, nvidia-cusparse-cu11, nvidia-curand-cu11, nvidia-cufft-cu11, nvidia-cuda-runtime-cu11, nvidia-cuda-nvrtc-cu11, nvidia-cuda-cupti-cu11, nvidia-cublas-cu11, numpy, networkx, MarkupSafe, idna, filelock, charset-normalizer, certifi, requests, nvidia-cusolver-cu11, nvidia-cudnn-cu11, jinja2, triton, torch, torchvision, clip
Successfully installed MarkupSafe-2.1.2 certifi-2023.5.7 charset-normalizer-3.1.0 clip-1.0 cmake-3.26.3 filelock-3.12.0 idna-3.4 jinja2-3.1.2 lit-16.0.6 mpmath-1.3.0 networkx-3.1 numpy-1.25.2 nvidia-cublas-cu11-11.10.3.66 nvidia-cuda-cupti-cu11-11.7.101 nvidia-cuda-nvrtc-cu11-11.7.99 nvidia-cuda-runtime-cu11-11.7.99 nvidia-cudnn-cu11-8.5.0.96 nvidia-cufft-cu11-10.9.0.58 nvidia-curand-cu11-10.2.10.91 nvidia-cusolver-cu11-11.4.0.1 nvidia-cusparse-cu11-11.7.4.91 nvidia-nccl-cu11-2.14.3 nvidia-nvtx-cu11-11.7.91 pillow-9.5.0 regex-2023.5.5 requests-2.31.0 sympy-1.12 torch-2.0.1 torchvision-0.15.2 tqdm-4.65.0 triton-2.0.0 typing-extensions-4.7.0 urllib3-2.0.3

Finally, the installation is successful, and the problem is solved!

 

 

Guess you like

Origin blog.csdn.net/lsb2002/article/details/132298835