Tensorflow Run Error or the interface is stuck or report error: Could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR

When running the more complex deep learning model of tessorflow, it is easy to get stuck in the interface
if it is a single graphics card (there is f at the end of the CPU model), you can install OpenGL and restart it before running the code
if course not create cudnn handle: cudnn appears_STATUS_INTERNAL_Error is reported, which is caused by insufficient video memory. Add

#Used to limit the use of video memory
config = tf.compat.v1.ConfigProto(gpu_options=tf.compat.v1.GPUOptions(allow_growth=True))
sess = tf.compat.v1.Session(config=config)
###############

The problem can be solved

Read More: