RuntimeError: CUDA out of memory. Tried to allocate 128.00 MiB (GPU 0; 4.00 GiB total capacity; 2.48 GiB already allocated; 0 bytes free; 2.77 GiB reserved in total by PyTorch)
报错的是这样的,我尝试把batch_size调小也没有解决问题,在网上说加with torch.no_grad():,但是我不知道加在哪里,所以请教一下,这是我复现的第一篇论文,意义重大