遇到的问题
在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文章来源:https://www.toymoban.com/news/detail-442907.html
保存修改之后再次运行webui-user.bat就可以了。如果这个解决方法还没解决问题,可以查看同个issue下的其它回答,或者能找到解决方法。文章来源地址https://www.toymoban.com/news/detail-442907.html
参考链接
- Torch is not able to use GPU
- How to install Stable Diffusion on Windows (AUTOMATIC1111)
到了这里,关于解决在Windows安装stable diffusion遇到“Torch is not able to use GPU”的问题的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!