KerasによるGPUメモリの占有を防ぐ

teratail.com
以下を実行する。

import os
os.environ['TF_FORCE_GPU_ALLOW_GROWTH'] = 'true'