Could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR
要在文件开始处添加:
config = tf.compat.v1.ConfigProto(gpu_options=tf.compat.v1.GPUOptions(allow_growth=True))
sess = tf.compat.v1.Session(config=config)
原因是因为tensorflow会申请整个显卡内存,虽然它用不到,比如我是rtx2070(8g显存),他就申请8G,但是有其他程序在使用,所以失败。