我正在使用Cuda和Pytorch:1.4.0。CUDA out of memory. Tried to allocate 20.00 MiB (GPU 0; 4.00 GiB total capacity; 2.74 GiB already allocated; 7.80 MiB free; 2.96 GiB reserved in total by PyTorch)另外,我不明白为什么我只有7.80的mib?
我应该使用性能更好的录像机,还是可以释放一些内存?FYI,我有一个GTX
我在使用火炬和数据自动化系统上遇到了麻烦。有时它工作得很好,其他时候它告诉我RuntimeError: CUDA out of memory.,但是我很困惑,因为检查nvidia-smi显示我的卡的使用内存是563MiB / 6144 MiB,理论上这应该使5GiB可用。
然而,在运行我的程序时,我会收到这样的消息:RuntimeError: CUDA out of memory. Tried to allocate 578.00 MiB (GPU 0; 5.81 GiB total capacity; 670.69 MiB already allocated; 624.31 MiB f
使用CUDA相对较新。在一段看似随机的时间后,我一直收到以下错误: RuntimeError: CUDA error:遇到非法内存访问 我看到人们建议使用cuda.set_device()而不是cuda.device(),设置torch.backends.cudnn.benchmark = False 但我似乎不能让这个错误消失。下面是我的一些代码片段:torch.cuda.set_device(torch.device('cuda:0')) torch.backends.cudnn.benchmark = False class LSTM(nn.Module):
d