ConvLSTM2DCell的错误:“元组”对象没有属性“ _keras_shape”

时间:2019-09-21 18:18:21

标签: keras lstm

我正在建立一个新模型,该模型需要使用Keras的ConvLSTM2DCells。 但我遇到一个错误,提示'tuple' object has no attribute '_keras_shape'

这是我的代码段:

inputs = keras.Input(shape=(64, 32, 4))
h0 = keras.Input(shape=(64, 32, 64))
CL2DCell = keras.layers.ConvLSTM2DCell(filters=64, kernel_size=(3, 3), padding='same')
x, [h, c] = CL2DCell(inputs, states=[h0, h0])

这是其他详细信息。

    563         # Update tensor history, _keras_shape and _uses_learning_phase.
    564         for i in range(len(output_tensors)):
--> 565             output_tensors[i]._keras_shape = output_shapes[i]
    566             uses_lp = any(
    567                 [getattr(x, '_uses_learning_phase', False)

AttributeError: 'tuple' object has no attribute '_keras_shape'

谢谢。

0 个答案:

没有答案