RuntimeError: CUDA out of memory. Tried to allocate 20.00 MiB (GPU 0; 2.00 GiB total capacity; 927.65 MiB already allocated; 429.55 MiB free; 1014.00 MiB reserved in total by PyTorch)
报错
1.可能是之前运行的程序没有释放导致空间占据,释放内存
2.改小全局变量中batch_size的值,尝试改成1
RuntimeError: CUDA out of memory. Tried to allocate 20.00 MiB (GPU 0; 2.00 GiB total capacity; 927.65 MiB already allocated; 429.55 MiB free; 1014.00 MiB reserved in total by PyTorch)
报错
1.可能是之前运行的程序没有释放导致空间占据,释放内存
2.改小全局变量中batch_size的值,尝试改成1