RuntimeError: CUDA out of memory. Tried to allocate 98.00 MiB (GPU 0; 5.79 GiB total capacity; 4.75

使用pytorch进行训练是报出以下错误

RuntimeError: CUDA out of memory. Tried to allocate 98.00 MiB (GPU 0; 5.79 GiB total capacity; 4.75 GiB already allocated; 25.38 MiB free; 4.86 GiB reserved in total by PyTorch)

这是因为GPU的内存溢出,可以调小batch_size

发布了125 篇原创文章 · 获赞 63 · 访问量 22万+

猜你喜欢

转载自blog.csdn.net/u011573853/article/details/105638605