3- OOM with a lot of GPU memory left.
4. RuntimeError: CUDA out of memory.
Answers -
1- It generally happens when we use the PyTorch version above 1.9.1, So first of all, check the version of PyTorch if it is 1.10.1 or higher, then degrade the version of it up to 1.9.1 or 1.8.1. We use the Cuda version above 10.2 for the case of RTX 3060 or above; therefore, when we install Cuda 11.2 or above, it comes with PyTorch version 1.12.1 or 1.10.1. And the code which we are running may be written for Pytorch version 1.6.1 or lower version, so some operation takes more space in Pytroch version 1.10.1 or above; therefore, we have to degrade the version of PyTorch.
# If you are using GPU RTX 3060 are above series, then you have to install Cuda 11.3, or above version, Otherwise it will give an error. And once you install default Cuda 11.3 or above, it will come with PyTorch 1.10.1 or above, so if you are getting an error, then degrade your PyTorch using the following commands
For pytorch 1.8.0 and cuda 11
$ pip3 install torch==1.8.1+cu111 -f https://download.pytorch.org/whl/torch_stable.html
2- Reduce the train batch size.
Problem 2:
Collecting torch==1.13.1 (from Calvin==0.0.1)
Using cached torch-1.13.1-cp38-cp38-manylinux1_x86_64.whl (887.4 MB)
ERROR: THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE. If you have updated the package versions, please update the hashes. Otherwise, examine the package contents carefully; someone may have tampered with them.
torch==1.13.1 from https://files.pythonhosted.org/packages/6b/0e/c640bda79e61766896fe16dfe0a3ab12b06ad50cf8814950518896dec0a5/torch-1.13.1-cp38-cp38-manylinux1_x86_64.whl (from Calvin==0.0.1):
Expected sha256 727dbf00e2cf858052364c0e2a496684b9cb5aa01dc8a8bc8bbb7c54502bdcdd
Got e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
Solution 2: Clean your cache.
$ pip cache purge