stable-diffusion-webui icon indicating copy to clipboard operation
stable-diffusion-webui copied to clipboard

issue with installing torch and torchvision

Open ceria117 opened this issue 3 years ago • 9 comments

I have tried reinstalling python, git, and deleted the repository and started fresh multiple times. Every time I am recieved by the same infinite loading. The last thing my command prompt displays is "Installing torch and torchvision" and after that, nothing changes no matter how long I leave it. I have had to play around with python installs for a while now: Problem 1: wrong version of python/pip was being used and it couldn't install torch as it couldnt grab the correct version. Problem 2: After deleting all instances of python, i had a problem with my python PATH "Fatal Python error: Py_Initialize: unable to load the file system codecModuleNotFoundError: No module named 'encodings'" (the only way I could fix this was to install python on a different drive) Now I am met with my third problem and I have no idea what could be causing it.

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Windows 11
  • Nvidia RTX 2070 8gb VRAM
  • Intel i9 9700k
  • 32gb DDR4 RAM

Torch issue installing

ceria117 avatar Oct 13 '22 03:10 ceria117

i use my pycharm to get torch and torchvision 1665645617696 but i fail to get gfpgan in the same way 1665645673205

huangruolun avatar Oct 13 '22 07:10 huangruolun

That step can take quite some time without feedback. Disable your antivirus and firewall during installation.

kybercore avatar Oct 13 '22 08:10 kybercore

I also encounter the same problem. When I start webui.bat, it will always stay at this step, although I have installed torch in the virtual environment.

VCE1 avatar Oct 14 '22 13:10 VCE1

You should check CUDA version. This code install pytorch that only support cuda 11.3 version

baejun10 avatar Oct 15 '22 09:10 baejun10

Same issue. Infinite "installing torch and torchvision". Running on Python 3.10.8, and theoretically I've already installed torch and torchvision with pip

Neeqstock avatar Oct 15 '22 21:10 Neeqstock

Same. Running Python 3.10.6. Definitely not an issue of not waiting enough time, I've ran it for about an hour just to be sure.

Vinski91 avatar Oct 16 '22 15:10 Vinski91

Ok, I've got it, installed and running. The problem is that the script doesn't give any feedback, no echo, nothing, while it's downloading gigabytes of stuff. I simply had to wait for my very slow connection to download everything. I hope the developers will fix this, some feedback could be very useful in this case...

To check if the installation is running, and things are getting downloaded, in the meanwhile, I found useful to see if my internet connection was being used. E.g., on Windows, you can simply see through the system's Task Manager if the Python process is using your network.

Neeqstock avatar Oct 16 '22 15:10 Neeqstock

I deal with this problem in the following way:

  1. define the venv path in webui-user.bat, such as 'set VENV_DIR=D:\Anaconda3\envs\torch', this is the path of your conda environment with torch.
  2. edit 29th line of webui.bat from 'set PYTHON="%~dp0%VENV_DIR%\Scripts\Python.exe"' to ''set PYTHON="%VENV_DIR%\Scripts\Python.exe"

It works on my Win10 OS.

Zejun-Yang avatar Oct 26 '22 08:10 Zejun-Yang

I got this problem on ubuntu 20.04,I use Nvidia 450 driver and cuda 11.0 {defualt by VPS provider), Then I search CUDA on google and install the latest version (by add apt repo), After installed,I got this by run nvidia-smi, NVIDIA-SMI 520.61.05 Driver Version: 520.61.05 CUDA Version: 11.8 , Then I run webui.sh again,and use slurm to check it's really start download and install ,it works , Current RX Speed: 12418.50 KB/s
After about 5 mins python3 use one of my cpus fully,the script continued and finish.

fs8vsx59h avatar Nov 28 '22 18:11 fs8vsx59h

I'm having issue on AMD 5700xt.

Followed these directions:

I deal with this problem in the following way:

  1. define the venv path in webui-user.bat, such as 'set VENV_DIR=D:\Anaconda3\envs\torch', this is the path of your conda environment with torch.
  2. edit 29th line of webui.bat from 'set PYTHON="%~dp0%VENV_DIR%\Scripts\Python.exe"' to ''set PYTHON="%VENV_DIR%\Scripts\Python.exe"

It works on my Win10 OS.

Still same issue.

Error code for webui.bat: stderr: ERROR: Could not find a version that satisfies the requirement torch==1.13.1+cu117 (from versions: none) ERROR: No matching distribution found for torch==1.13.1+cu117

Error code for webui-user.bat: AssertionError: Torch is not able to use GPU; add --skip-torch-cuda-test to COMMANDLINE_ARGS variable to disable this check

EDIT: I initially had the lastest Python installed, and now also installed 3.9 and set it to PATH. Still same as above.

emalinegayhart avatar Jan 24 '23 20:01 emalinegayhart

I'm having issue on AMD 5700xt.

Followed these directions:

I deal with this problem in the following way:

  1. define the venv path in webui-user.bat, such as 'set VENV_DIR=D:\Anaconda3\envs\torch', this is the path of your conda environment with torch.
  2. edit 29th line of webui.bat from 'set PYTHON="%~dp0%VENV_DIR%\Scripts\Python.exe"' to ''set PYTHON="%VENV_DIR%\Scripts\Python.exe"

It works on my Win10 OS.

Still same issue.

Error code for webui.bat: stderr: ERROR: Could not find a version that satisfies the requirement torch==1.13.1+cu117 (from versions: none) ERROR: No matching distribution found for torch==1.13.1+cu117

Error code for webui-user.bat: AssertionError: Torch is not able to use GPU; add --skip-torch-cuda-test to COMMANDLINE_ARGS variable to disable this check

EDIT: I initially had the lastest Python installed, and now also installed 3.9 and set it to PATH. Still same as above.

use this python launch.py --skip-torch-cuda-test

mmrvega avatar Jan 26 '23 14:01 mmrvega

Closing as stale.

catboxanon avatar Aug 03 '23 17:08 catboxanon