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

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

解决方法:

1.将batch_size改小

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

import os

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

posted @ 2021-03-15 09:09  裴枫丶  阅读(214)  评论(0)    收藏  举报