TensorFlow报错:This is probably because cuDNN failed to initialize
tensorflow.python.framework.errors_impl.UnknownError: 2 root error(s) found.
(0) Unknown: 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.
[[{{node efficientnet-b0/model/stem/conv2d/Conv2D}}]]
(1) Unknown: 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.
[[{{node efficientnet-b0/model/stem/conv2d/Conv2D}}]]
[[bottleneck/_777]]
0 successful operations.
0 derived errors ignored.
解决方法:
config = tf.compat.v1.ConfigProto(gpu_options=tf.compat.v1.GPUOptions(allow_growth=True))
sess = tf.compat.v1.Session(config=config)
之前的代码:sess = tf.Session()