Closed DerekGrant closed 4 years ago
I found the reason for this problem that dues to the mistake of the model's export path. When exploring the model, it should be saved to:
Model exported to: local-training-output/keras_export/1553709223
but in fact, may due to the tf version reason, it just exported to
Model exported to: local-training-output/keras_export/
So when you run
SAVED_MODEL_PATH = KERAS_EXPORT_DIRS[-1]
SAVED_MODEL_PATH is expected as "local-training-output/keras_export/1553709223"; but in fact, you will get "local-training-output/keras_export/variables"
Hence, when you save your model, it will tell you there isn't a "saved_model.pb" in "variables". I just copy a pb file to "variables" to solve it.
But later, when you want to predict, it will load model from "variables", where doesn't have any parameters of the model, so you will fail.
Describe the bug When I running the "getting-started-keras.ipynb", I met this problem that couldn't submit to prediction.
What sample is this bug related to? Getting started: training and prediction with Keras
Source code / logs When I was training, there were some warnings, I think they may lead to the problem.
The original codes has a problem that it won't save a "saved_model.pb" to "/variable", so I mannually copy it.
But when I was submitting to predict and running following codes:
There is an error:
To Reproduce Steps to reproduce the behavior: Just run all cells, and manually copy "saved_model.pb" to "/variable" Continue run
Expected behavior Getting the prediction result
System Information Colab default configuration