Skip to content

Instantly share code, notes, and snippets.

@mcotton
Last active February 7, 2020 13:50
Show Gist options
  • Save mcotton/b9b9bdacbab613c654a6bc9b87018424 to your computer and use it in GitHub Desktop.
Save mcotton/b9b9bdacbab613c654a6bc9b87018424 to your computer and use it in GitHub Desktop.
fix for Could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR
#
# Look at https://www.tensorflow.org/guide/gpu for an explaination
# Here are the two options they presented
#
# Option 1
# set_memory_growth before creatingt the CONV network
import tensorflow as tf
gpus = tf.config.experimental.list_physical_devices('GPU')
for gpu in gpus:
tf.config.experimental.set_memory_growth(gpu, True)
# Option 2
# set env variable in shell or .bashrc
export TF_FORCE_GPU_ALLOW_GROWTH="true"
export TF_CPP_MIN_LOG_LEVEL=2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment