ai-toolkit
ai-toolkit copied to clipboard
AssertionError: Torch not compiled with CUDA enabled
Getting this error when trying to run the script
-
Check if your system has CUDA installed:
nvcc --version -
Run the following .py code to verify if PyTorch can detect your GPU:
import torch print(torch.cuda.is_available())If it returns
False, PyTorch isn't detecting CUDA, meaning that the installed version might be CPU-only. -
Install the Correct Version of PyTorch:
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121 -
Verify Installation:
import torch print(torch.cuda.is_available()) print(torch.cuda.get_device_name(0)) -
Try running the config again
the same mistake,still not solved
Hi, turns out the issue was that I was using the wrong start command (on Windows) so use python run.py config/whatever_you_want.yml instead of python3 run.py config/whatever_you_want.yml
Hi, turns out the issue was that I was using the wrong start command (on Windows) so use python run.py config/whatever_you_want.yml instead of python3 run.py config/whatever_you_want.yml
This exists to distinguish between Python 2.x and Python 3.x installations on systems where both versions are available. Nowadays, Python 2 is hardly ever used, so the best way is to check which one you have is with --version:
python --version
python3 --version
pip --version
pip3 --version
Try
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
Looks like the wrong torch is being picked up, that version should include CUDA 11.8. Just saw this also mentioned on main page, but with cu121.