Last active
August 6, 2020 05:57
-
-
Save sizhky/f4c54b06fda19b9a8c65c3692a0825fa to your computer and use it in GitHub Desktop.
Prevents Tensorflow from hogging all the GPU resources
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
import tensorflow as tf | |
config = tf.ConfigProto() | |
config.gpu_options.allow_growth=True | |
sess = tf.Session(config=config) | |
import tensorflow as tf | |
config = tf.compat.v1.ConfigProto() | |
config.gpu_options.allow_growth=True | |
sess = tf.compat.v1.Session(config=config) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment