Could not create cudnn handle: CUDNN_STATUS_ALLOC_FAILED
报错:tensorflow.python.framework.errors_impl.UnknownError: Failed to get convolution algorithm. This is probably because cuDNN failed to initialize, so try looking to see if a warning log message was printed above. [Op:Conv2D]
明明cuda、tensorflow、cudnn的版本都对着,但是还是报错,原因是GPU的显存设置问题。
config = tf.compat.v1.ConfigProto(gpu_options=tf.compat.v1.GPUOptions(allow_growth=True))
sess = tf.compat.v1.Session(config=config)
设置为尽在需要的时候分配内存即可。
记录一下。