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.
本地环境:
Tensorflow 2.1
CuDNN 7.6.5
cudatoolkit 10.1.243
版本是匹配的!问题出在GPU使用的时候没有设置使用比例,导致GPU使用超限!
在项目头部加上如下代码即可:
from tensorflow.compat.v1 import ConfigProto
from tensorflow.compat.v1 import InteractiveSession
config = ConfigProto()
config.gpu_options.allow_growth = True
session = InteractiveSession(config=config)