ResourceExhaustedError: OOResourceExhaustedError: OOM when allocating tensor with shapeM when allocating tensor with shape

时间:2021-03-16 13:56:03   收藏:0   阅读:0

原因:是因为gpu显存太小而导致的错误。

解决方法:

1.将batch_size改小

2.不用gpu训练,改用cpu训练

import os

os.environ["CUDA_VISIBLE_DEVICES"] = "-1"

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!