I'm having a hard time saving keras model and loading it.
It continues to raise the: AttributeError: 'str' object has no attribute 'decode'
when I load_model()
import numpy as np
import pandas as pd
from keras.utils import to_categorical
from keras.preprocessing.sequence import pad_sequences
from keras.models import Sequential
from keras.layers import LSTM, Dense, GRU, Embedding
from keras.callbacks import EarlyStopping, ModelCheckpoint
activation='softmax'
loss ='categorical_crossentropy'
optimizer ='adam'
epochs = 2
# generate model
model = Sequential()
model.add(Embedding(vocab, 100, input_length=n, trainable=True))
model.add(GRU(150, recurrent_dropout=0.1, dropout=0.1))
model.add(Dense(vocab, activation=activation))
print(model.summary())
# compile the model
model.compile(loss=loss, metrics=['acc'], optimizer=optimizer)
# fit the model
model.fit(X_tr, y_tr, epochs=epochs, verbose=2, validation_data=(X_val, y_val))
# saving model
model.save("model_test.h5")
# load model
from keras.models import load_model
# load model
new_model = tf.keras.models.load_model("model_test")
returns: AttributeError: 'str' object has no attribute 'decode'