Stable-diffusion-person icon indicating copy to clipboard operation
Stable-diffusion-person copied to clipboard

Error message:RuntimeError···

Open A-moroso opened this issue 1 year ago • 3 comments

Error during execution——>RuntimeError: Detected that PyTorch and torchvision were compiled with different CUDA versions. PyTorch has CUDA Version=11.7 and torchvision has CUDA Version=11.8. Please reinstall the torchvision that matches your PyTorch install. image

A-moroso avatar Apr 12 '23 03:04 A-moroso

随便找个代码块执行下面的命令

%pip install torch==1.13.1+cu117 torchvision==0.14.1+cu117 torchtext==0.14.1 torchaudio==0.13.1 torchdata==0.5.1 --extra-index-url https://download.pytorch.org/whl/cu117

barryoo avatar Apr 12 '23 05:04 barryoo

随便找个代码块执行下面的命令

%pip install torch==1.13.1+cu117 torchvision==0.14.1+cu117 torchtext==0.14.1 torchaudio==0.13.1 torchdata==0.5.1 --extra-index-url https://download.pytorch.org/whl/cu117

执行这句代码又出现了新的错误,请您处理一下:

looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/, https://download.pytorch.org/whl/cu117
Collecting torch==1.13.1+cu117
  Using cached https://download.pytorch.org/whl/cu117/torch-1.13.1%2Bcu117-cp39-cp39-linux_x86_64.whl (1801.8 MB)
Collecting torchvision==0.14.1+cu117
  Using cached https://download.pytorch.org/whl/cu117/torchvision-0.14.1%2Bcu117-cp39-cp39-linux_x86_64.whl (24.3 MB)
Requirement already satisfied: torchtext==0.14.1 in /usr/local/lib/python3.9/dist-packages (0.14.1)
Requirement already satisfied: torchaudio==0.13.1 in /usr/local/lib/python3.9/dist-packages (0.13.1+cu117)
Requirement already satisfied: torchdata==0.5.1 in /usr/local/lib/python3.9/dist-packages (0.5.1)
Requirement already satisfied: typing-extensions in /usr/local/lib/python3.9/dist-packages (from torch==1.13.1+cu117) (4.5.0)
Requirement already satisfied: requests in /usr/local/lib/python3.9/dist-packages (from torchvision==0.14.1+cu117) (2.27.1)
Requirement already satisfied: pillow!=8.3.*,>=5.3.0 in /usr/local/lib/python3.9/dist-packages (from torchvision==0.14.1+cu117) (9.5.0)
Requirement already satisfied: numpy in /usr/local/lib/python3.9/dist-packages (from torchvision==0.14.1+cu117) (1.22.4)
Requirement already satisfied: tqdm in /usr/local/lib/python3.9/dist-packages (from torchtext==0.14.1) (4.65.0)
Requirement already satisfied: portalocker>=2.0.0 in /usr/local/lib/python3.9/dist-packages (from torchdata==0.5.1) (2.7.0)
Requirement already satisfied: urllib3>=1.25 in /usr/local/lib/python3.9/dist-packages (from torchdata==0.5.1) (1.26.15)
Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.9/dist-packages (from requests->torchvision==0.14.1+cu117) (3.4)
Requirement already satisfied: charset-normalizer~=2.0.0 in /usr/local/lib/python3.9/dist-packages (from requests->torchvision==0.14.1+cu117) (2.0.12)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.9/dist-packages (from requests->torchvision==0.14.1+cu117) (2022.12.7)
Installing collected packages: torch, torchvision
  Attempting uninstall: torch
    Found existing installation: torch 2.0.0
    Uninstalling torch-2.0.0:
      Successfully uninstalled torch-2.0.0
  Attempting uninstall: torchvision
    Found existing installation: torchvision 0.15.1
    Uninstalling torchvision-0.15.1:
      Successfully uninstalled torchvision-0.15.1
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
open-clip-torch 2.7.0 requires protobuf==3.20.0, but you have protobuf 3.20.3 which is incompatible.
Successfully installed torch-1.13.1+cu117 torchvision-0.14.1+cu117

mmmmmdain avatar Apr 17 '23 12:04 mmmmmdain

随便找个代码块执行下面的命令

%pip install torch==1.13.1+cu117 torchvision==0.14.1+cu117 torchtext==0.14.1 torchaudio==0.13.1 torchdata==0.5.1 --extra-index-url https://download.pytorch.org/whl/cu117

注意,需要先执行这个命令,再执行Colab中原有的代码块。

或者将这句代码插入到倒数第二行,即最后一行的!COMMANDLINE_ARGS……之上。

原理为提前手动安装正确版本的依赖。

imldy avatar Apr 18 '23 07:04 imldy