Created
November 12, 2018 14:54
-
-
Save kadeng/5a1c5c3a9953e43c15453609c06ca915 to your computer and use it in GitHub Desktop.
Tensorflow report_tensor_allocations_upon_oom
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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