You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 3, 2022. It is now read-only.
@lzfelix I am using google colab, its a pretty simple network that uses an LSTM-BiLSTM and CRF. But I get this error " AttributeError: 'Tensor' object has no attribute '_keras_history'", when model.fit() is called.
I understand that I shouldn't have any + operations or numpy.add() and replace them with ADD(), but this is not my case. I also tried wrapping it Lambda function but it didn't work out(I think I wasnt dong it right)
Any help would be highly appreciated
This is my code:
input = Input(shape=(140,))
word_embedding_size = 300
model = Embedding(input_dim=n_words, output_dim=word_embedding_size, input_length=140)(input)
model = Bidirectional(LSTM(units=word_embedding_size,
return_sequences=True,
dropout=0.5,
recurrent_dropout=0.5,
kernel_initializer=k.initializers.he_normal()))(model)
model = LSTM(units=word_embedding_size * 2,
return_sequences=True,
dropout=0.5,
recurrent_dropout=0.5,
kernel_initializer=k.initializers.he_normal())(model)
model = TimeDistributed(Dense(n_tags, activation="relu"))(model) # previously softmax output layer
crf = CRF(n_tags) # CRF layer
out = crf(model) # output
model = Model(input, out)
adam = k.optimizers.Adam(lr=0.0005, beta_1=0.9, beta_2=0.999)
#model.compile(optimizer=adam, loss="categorical_crossentropy", metrics=["accuracy"])
model.compile(optimizer=adam, loss=crf.loss_function, metrics=[crf.accuracy, 'accuracy'])
model.summary()
history = model.fit(X_train, np.array(y_train), batch_size=256, epochs=20, validation_split=0.2, verbose=1, callbacks=callbacks_list)
@lzfelix I am using google colab, its a pretty simple network that uses an LSTM-BiLSTM and CRF. But I get this error " AttributeError: 'Tensor' object has no attribute '_keras_history'", when model.fit() is called.
I understand that I shouldn't have any + operations or numpy.add() and replace them with ADD(), but this is not my case. I also tried wrapping it Lambda function but it didn't work out(I think I wasnt dong it right)
Any help would be highly appreciated
This is my code:
filepath="ner-bi-lstm-td-model-{val_acc:.2f}.hdf5"
checkpoint = ModelCheckpoint(filepath, monitor='val_acc', verbose=1, save_best_only=True, mode='max')
callbacks_list = [checkpoint]
This is when I wrap in Lambda function:
This the error and traceback:
The text was updated successfully, but these errors were encountered: