当前位置: 代码迷 >> 综合 >> Failed to get convolution algorithm.This is probably because cuDNN failed to initialize
  详细解决方案

Failed to get convolution algorithm.This is probably because cuDNN failed to initialize

热度:39   发布时间:2023-12-14 08:31:20.0

报错原因: 内存分配出现了问题
解决方案: 在代码前加上如下代码

import tensorflow as tf
gpus = tf.config.list_physical_devices("GPU")if gpus:gpu0 = gpus[0] #如果有多个GPU,仅使用第0个GPUtf.config.experimental.set_memory_growth(gpu0, True) #设置GPU显存用量按需使用tf.config.set_visible_devices([gpu0],"GPU") 
  相关解决方案