Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kadeng/5a1c5c3a9953e43c15453609c06ca915 to your computer and use it in GitHub Desktop.
Save kadeng/5a1c5c3a9953e43c15453609c06ca915 to your computer and use it in GitHub Desktop.
Tensorflow report_tensor_allocations_upon_oom
# Working Example to use report_tensor_allocations_upon_oom
# with recent Tensorflow and Keras
config = tf.ConfigProto()
config.gpu_options.allow_growth = True
sess = tf.Session(config = config)
K.set_session(sess)
run_opts = tf.RunOptions(report_tensor_allocations_upon_oom = True)
run_metadata = tf.RunMetadata()
# ...
model.compile(optimizer='adam',
loss=od_loss,
metrics=metrics,, options=run_opts, run_metadata=run_metadata)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment