Keras中的双向层:不支持的操作数类型

时间:2018-07-04 12:17:17

标签: keras

我的双向网络出现错误

model = Sequential()
model.add( Bidirectional(LSTM(units = 128, return_sequences = True),
                         input_shape = input_shape[1:]) )
#model.add( Bidirectional(LSTM(64, return_sequences = True) ))
model.add( TimeDistributed(Dense(units = language_vocab_size, 
                 activation = 'softmax')) )
learning_rate = 0.01
model.compile(loss=sparse_categorical_crossentropy,
              optimizer=Adam(learning_rate),
              metrics=['accuracy'])
return model

返回的错误是:

  

TypeError:+不支持的操作数类型:“ NoneType”和“ int”

究竟是什么导致此错误?

0 个答案:

没有答案