首页 > 解决方案 > 尽管可用,但 Cuda 内存不足

问题描述

我正在尝试对一些大小为 256x256 的图像运行 GAN。但是,每当我开始训练时,我都会收到此错误:

RuntimeError: CUDA out of memory. Tried to allocate 2.19 GiB (GPU 0; 10.00 GiB total capacity; 437.15 MiB already allocated; 6.38 GiB free; 1.51 GiB reserved in total by PyTorch)

我不知道如何解决它。似乎有足够的内存,所以我很困惑为什么会发生这种情况。

标签: python-3.xmemory-managementpytorch

解决方案


推荐阅读