Not enough memory: you tried to allocate 20971520 bytes
Sometimes when i try to train a model, it give me this error:
not enough memory: you tried to allocate 20971520 bytes
I am using an Intel i5 8400 CPU with 16gb of ram, and an AMD RX 6400 GPU (it doesn't get recognised/it's not compatible so it's not getting used)
I do know these specs aren't the best for training, but i've already made a few models with it so it should work.
Usually I just try again or restart the computer and it works but it's really persistent on a specific model i'm trying to continue training on. Anyone know why that happens and how I can fix it ? Thanks.
I have an Nvidia GPU, so I don't know exactly how to solve your problem, but I bet it is a similar process. The problem I had was that torch was utilizing my CPU instead of my GPU.
This fixed it, but this assumes you have CUDA cores, which is an Nvidia thing:
pip install torch torchvision torchaudio --upgrade --index-url https://download.pytorch.org/whl/cu118
Here is something that may work for you, but it looks like it only works on Linux. Worth trying anyway though:
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/rocm5.4.2