I am using one of the above methods to save my model. But I get this below error , can some one help me . I am very new to this tensor flows. My Code is
Model Creation
model = Sequential()
model.add(Embedding(vocab_size, 8, input_length=max_length))
model.add(Flatten())
model.add(Dense(512, activation='relu'))
model.add(Dense(256, activation='relu'))
model.add(Dropout(.2))
model.add(Dense(128, activation='relu'))
model.add(Dense(64, activation='relu'))
model.add(Dense(number_of_classes, activation='softmax'))
# compile the model
##only use if pre-trained
sgd = optimizers.SGD(lr=0.01, decay=1e-6, momentum=0.9, nesterov=True)
model.compile(optimizer='adam', loss='categorical_crossentropy', metrics=['acc'])
input_shape = X.shape
model.build(input_shape)
# summarize the model
model.summary()
checkpoint = ModelCheckpoint('Files5.hdf5', monitor='val_acc', verbose=1, save_best_only=True, mode='max')
history = model.fit(X_train, Y_train, validation_data=(X_val, Y_val), epochs=10, batch_size=20, callbacks=[checkpoint_callback], verbose=2)
return model, history
NotImplementedError: Layer ModuleWrapper has arguments in __init__
and therefore must override get_config
I referred these ones - but still no luck
Layer ModuleWrapper has arguments in `__init__` and therefore must override `get_config`. in Colab
How to save final model using keras?
Thank you