检查失败:stream-> parent()-> GetConvolveBackwardDataAlgorithms

时间:2020-04-14 12:14:10

标签: tensorflow keras nvidia cudnn

我正在建立作为gan一部分的模型。以前我的gpu兼容性有几个问题,但是此错误是新错误,我找不到任何人发布完全相同的错误:

def build_generator(inputs, image_size):
    layer_filters = [256, 128, 64, 32, 3]
    strides = 2
    x = inputs
    for filters in layer_filters:
        x = Conv2DTranspose(filters=filters,kernel_size=(3,3),strides=strides,padding='same')(x)
        x = Activation('relu')(x)
        x = BatchNormalization()(x)
    x = Activation('sigmoid')(x)
    generator = Model(inputs, x, name='generator')
    generator.compile(loss='binary_crossentropy',optimizer=adam_optimizer(),metrics=['accuracy'])
    return generator
inputs = Input(shape=(2,2,480))
g = build_generator(inputs, (64,64,3))

当我尝试做时:

g.predict(np.random.normal(size=(2,2,2,480)))

我得到了错误:

Could not create cudnn handle: CUDNN_STATUS_ALLOC_FAILED
2020-04-14 15:04:39.572260: F tensorflow/core/kernels/conv_grad_input_ops.cc:1163] Check failed: stream->parent()->GetConvolveBackwardDataAlgorithms( conv_parameters.ShouldIncludeWinogradNonfusedAlgo<T>(stream->parent()), &algorithms)

版本:

anaconda (python 3.7)
tensorflow 2.1
keras 2.3.1
cudd 7.6.5
cuda toolkit 10.1.2
gpu nvidia gtx 1660Ti (6GB)

这就是我让keras使用pgu的方法:

gpus= tf.config.experimental.list_physical_devices('GPU')
tf.config.experimental.set_memory_growth(gpus[0], True)
from tensorflow.python.client import device_lib
print(device_lib.list_local_devices())

有什么想法吗?

0 个答案:

没有答案