Hi @madhumilan, welcome to the Streamlit community!
Thank you for sharing your repo. As you’ve noted, you have placed your saved model saved_model.pb
in the same directory as your Streamlit app. As such, you can pass an empty string in line 17.
Replace line 17 with:
loaded_model = tf.keras.models.load_model("")
TensorFlow should be able to find your saved_model.pb
file. However, you may have uploaded incorrect files to your variables/
directory.
According to the documentation, when you create your SavedModel with model.save('my_model')
, it should contain the model architecture and configuration in saved_model.pb
, and weights saved in the variables/
directory. However, the variables/
directory in your repo contains saved_model.pb
instead of the weights. So you will run into another error even after passing the right path in line 17. Just something to keep in mind.
Best,
Snehan