遇到的問題
在Windows上安裝stable diffusion的最后一步執(zhí)行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文章來源:http://www.zghlxwxcb.cn/news/detail-442907.html
保存修改之后再次運行webui-user.bat就可以了。如果這個解決方法還沒解決問題,可以查看同個issue下的其它回答,或者能找到解決方法。文章來源地址http://www.zghlxwxcb.cn/news/detail-442907.html
參考鏈接
- Torch is not able to use GPU
- How to install Stable Diffusion on Windows (AUTOMATIC1111)
到了這里,關(guān)于解決在Windows安裝stable diffusion遇到“Torch is not able to use GPU”的問題的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!