Closed EmreSafaCelik closed 2 months ago
Hi @EmreSafaCelik ,
Thanks for letting us know about this problem. We're aware it's due to recent changes in Keras 3. Specifically, there's an issue with how the code references tf.keras
which now points to Keras 3. We'll fix the notebook to address this and provide an update as soon as possible.
Thanks.
Alright, thank you!
Having the same problem here! Thanks!
Hi @EmreSafaCelik ,
Thanks for letting us know about this problem. We're aware it's due to recent changes in Keras 3. Specifically, there's an issue with how the code references
tf.keras
which now points to Keras 3. We'll fix the notebook to address this and provide an update as soon as possible.Thanks.
Hi
There's any update on this?
Thanks!
Hi @engares,
We are still working on it , you will see a comment here from our side once we fixing the changes.
Thanks
Hi @engares,
You can just change the line:
import tensorflow as tf
to:
import tensorflow as tf, tf_keras
then change all tf.keras.
calls to start with tf_keras.
instead. Hope this helps.
Prerequisites
Please answer the following questions for yourself before submitting an issue.
1. The entire URL of the file you are using
https://github.com/tensorflow/models/blob/master/official/projects/movinet/movinet_streaming_model_training_and_inference.ipynb
2. Describe the bug
Noticed 4 errors on movinet streaming_model_training_and_inference notebook, impossible to train and export the streaming model using this as the guide.
3. Steps to reproduce
First off, if running on kaggle you will get the following error when downloading tf-models-official, but you can (safely?) ignore it and continue:
Error 1-) When simply running through the cells we get to the cell:
Which gives the error:
A workaround to this is to change the compiling from:
model.compile(loss=loss_obj, optimizer=optimizer, metrics=['accuracy'])
to:
model.compile(loss=loss_obj, optimizer="adam", metrics=['accuracy'])
this means we do not specify learning rate, but at least we get past this part to see the other errors.
Error 2-) After continuing we get to this part:
which gives the easily solvable error:
we pass it by changing from .ckpt to .weights.h5:
checkpoint_path = "trained_model/cp.weights.h5"
the change of behaviour does not matter since we won't even be able to use the callback because of the next error
Error 3-) we continue to the next cell:
Which gives the error I couldn't manage to solve:
What we can do is remove the callback alltogether to see the errors existing later in the code:
Error 4-) The next error is in "Reconstruct the whole model with
use_external_states=True
to make the inference using states." part's first cell, this error will be fixed by itself once the errors 2 and 3 are fixed as it needs ModelCheckpoint to run (as per my broken understanding):4. System information
Errors exist both on Kaggle and Colab