遇到的问题
在Windows上安装stable diffusion的最后一步执行webui-user.bat时,提示了错误信息AssertionError: Torch is not able to use GPU; add --skip-torch-cuda-test to COMMANDLINE_ARGS variable to disable this check
具体错误代码如下:
- venv "C:\Users\giray\stable-diffusion-webui\venv\Scripts\Python.exe"
- Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug 1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
- Commit hash: 67d011b
- Traceback (most recent call last):
- File "C:\Users\giray\stable-diffusion-webui\launch.py", line 110, in
- run_python("import torch; assert torch.cuda.is_available(), 'Torch is not able to use GPU; add --skip-torch-cuda-test to COMMANDLINE_ARGS variable to disable this check'")
- File "C:\Users\giray\stable-diffusion-webui\launch.py", line 60, in run_python
- return run(f'"{python}" -c "{code}"', desc, errdesc)
- File "C:\Users\giray\stable-diffusion-webui\launch.py", line 54, in run
- raise RuntimeError(message)
- RuntimeError: Error running command.
- Command: "C:\Users\giray\stable-diffusion-webui\venv\Scripts\python.exe" -c "import torch; assert torch.cuda.is_available(), 'Torch is not able to use GPU; add --skip-torch-cuda-test to COMMANDLINE_ARGS variable to disable this check'"
- Error code: 1
- stdout:
- stderr: Traceback (most recent call last):
- File "", line 1, in
- AssertionError: Torch is not able to use GPU; add --skip-torch-cuda-test to COMMANDLINE_ARGS variable to disable this check
复制代码 解决方法
参考了github上的issue,需要修改webui-user.bat文件,具体更改如下:
COMMANDLINE_ARGS=
and change it to:
COMMANDLINE_ARGS= --lowvram --precision full --no-half --skip-torch-cuda-test
保存修改之后再次运行webui-user.bat就可以了。如果这个解决方法还没解决问题,可以查看同个issue下的其它回答,或者能找到解决方法。
参考链接
- Torch is not able to use GPU
- How to install Stable Diffusion on Windows (AUTOMATIC1111)
来源:https://blog.csdn.net/hcaohr/article/details/130122398
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作! |