RuntimeError: CUDA out of memory. Tried to allocate 16.00 MiB (GPU 0; 10.92 GiB total capacity; 3.66

1.在训练一个网络模型,报CUDA out of menmory:
CUDA out of menmory:先找到报错的信息,例如下图是out=net(x),因此需要给out=net(x)上面加 with torch.no_grad():
RuntimeError: CUDA out of memory. Tried to allocate 16.00 MiB (GPU 0; 10.92 GiB total capacity; 3.66_第1张图片RuntimeError: CUDA out of memory. Tried to allocate 16.00 MiB (GPU 0; 10.92 GiB total capacity; 3.66_第2张图片

你可能感兴趣的:(python,人工智能,深度学习)