RuntimeError: CUDA out of memory.
来源:4-7 利用神经网络解决分类和回归问题(5)

weixin_慕尼黑0465866
2021-09-26
RuntimeError: CUDA out of memory. Tried to allocate 20.00 MiB (GPU 0; 2.00 GiB total capacity; 1.21 GiB already allocated; 16.13 MiB free; 19.62 MiB cached)
遇到这种情况,是不是只能换显卡了呀?
写回答
1回答
-
会写代码的好厨师
2021-10-11
显存太小了。解决办法:1. 减少训练的batchsize;2.裁剪模型尺寸。3;换一块显卡
00
相似问题