RuntimeError: CUDA out of memory. Tried to allocate 98.00 MiB (GPU 0; 5.79 GiB total capacity; 4.75
程序员文章站
2022-03-20 23:52:15
...
使用pytorch进行训练是报出以下错误
RuntimeError: CUDA out of memory. Tried to allocate 98.00 MiB (GPU 0; 5.79 GiB total capacity; 4.75 GiB already allocated; 25.38 MiB free; 4.86 GiB reserved in total by PyTorch)
这是因为GPU的内存溢出,可以调小batch_size