Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LSTM training error #6

Open
MihirBha opened this issue Apr 29, 2021 · 3 comments
Open

LSTM training error #6

MihirBha opened this issue Apr 29, 2021 · 3 comments

Comments

@MihirBha
Copy link

MihirBha commented Apr 29, 2021

No description provided.

@srivatsan88
Copy link
Owner

I see you are using fit method rather fit_generator. One is you can go back to 2.2 TF version and use fit_generator. I will try to change the code against latest version and update

@srivatsan88
Copy link
Owner

Hi, I was able to make the same code work on TF 2.5 as well. instead of fit_generated which is deprecated fit works as well. I am hardening the code and will upload in upcoming week

This is what I used in TF 2.5

early_stopping = tf.keras.callbacks.EarlyStopping(monitor='val_loss',
patience=2,
mode='min')

model.compile(loss=tf.losses.MeanSquaredError(),
optimizer=tf.optimizers.Adam(),
metrics=[tf.metrics.MeanAbsoluteError()])

history = model.fit(train_generator, epochs=20,
validation_data=val_generator,
shuffle=False,
callbacks=[early_stopping])

@MihirBha
Copy link
Author

MihirBha commented Jun 14, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants