Tag Archives: DL

RuntimeError: CUDA out of memory. Tried to allocate 600.00 MiB (GPU 0; 23.69 GiB total capacity)

RuntimeError: CUDA out of memory. Tried to allocate 600.00 MiB (GPU 0; 23.69 GiB total capacity; 21.82 GiB already allocated; 115.25 MiB free; 21.87 GiB reserved in total by PyTorch)

Runtime error: CUDA out of memory. Attempt to allocate 600.00 MIB (GPU 0; 23.69 gib total capacity; 21.82 gib allocated; 115.25 MIB free; pytorch reserves a total of 21.87 GIB)

reason

A similar bug is due to insufficient video memory

Solution 1: release the video memory

First fuser - V/dev/NVIDIA * or sudo fuser - V/dev/NVIDIA * , view the processes running on the GPU recently, and then sudo kill the relevant process number.

Of which:

Fuser: it can display which program is currently using a file, mount point, or even network port on the disk, and give the details of the program process – V: detailed mode/dev/NVIDIA *: all NVIDIA related interfaces (such as GPU)

Solution 2: turn down the batch size

If it is not enough after releasing part of the video memory, you can reduce the batch size


Reference:
after NVIDIA GPU kill process, the video memory is still unclear

spyder an error ocurred while starting the kernel (How to Fix)

I started the kernel with An error ocurred while running the Keras program using Spyder every time. Finally, I checked several methods before I solved it. I’ll share it with you.
The first method:
The problem is solved by typing Spyder — Reset in the terminal and resetting the Spyder configuration.
I tried this method and found that the problem was not solved. You can try it. Maybe yours can work out.
The second way

conda update spyder ipykernel tornado pyzmq

After running a bunch of libraries, I found that my problem was still unresolved.

The above two methods are more commonly used on the Internet. But in my case the problem has not been solved. I don’t know what’s going on. Finally, I thought to myself, why didn’t this happen before?Now it does. Comparison one is that the data set has changed. I used a 0.2 scale of data set in the program to perform the validation operation. Now 20% of the data set is not an integer. And Then I changed it. The kernel crash problem found above was resolved.
Maybe I’m doing this as an example, but I’ll put it up here for you to look at.