【发布时间】:2019-12-05 18:24:53
【问题描述】:
在我的 tensorflow2.0b 程序中,我确实收到了这样的错误
ResourceExhaustedError: OOM when allocating tensor with shape[727272703] and type int8 on /job:localhost/replica:0/task:0/device:GPU:0 by allocator GPU_0_bfc [Op:TopKV2]
此程序中的许多基于 GPU 的操作已成功执行后,会发生此错误。
我喜欢释放与这些过去操作相关的所有 GPU 内存以避免上述错误。如何在 tensorflow-2.0b 中做到这一点?如何从我的程序中检查内存使用情况?
我只能使用 tf.session() 找到相关信息,这在 tensorflow2.0 中不再可用
【问题讨论】:
-
请看看这个issue 应该可以帮助您解决问题。我想如果你减少批量大小,应该注意这个错误。
标签: python-3.x gpu tensorflow2.0