CUDA out of memory. Tried to allocate 150.00 MiB (GPU 0; 4.00 GiB total capacity; 2.24 GiB already a在报错的哪一行代码的上面,加上下面一行代码,不计算梯度with torch.no_grad(): 版权声明:本文为wyyyyyyyy_原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。原文链接:https://blog.csdn.net/wyyyyyyyy_/article/details/124517772