This is here i am loading model
This is the Error i getting
i have build dog breeds identification project one month ago it’s working fine TODAY I RUN again i got an unexpected error
i don’t understand the Error can anyone HELP ME
ERROR getting while i run on streamlit while i upload dog image i get error
TypeError: Error when deserializing class ‘KerasLayer’ using config={‘name’: ‘keras_layer_2’, ‘trainable’: False, ‘dtype’: ‘float32’, ‘handle’: ‘TensorFlow Hub’}. Exception encountered: Trying to load a model of incompatible/unknown type. ‘C:\Users\rm\AppData\Local\Temp\tfhub_modules\2c858e9d5fe42a1181c58c70d67244f7619f2ab2’ contains neither ‘saved_model.pb’ nor ‘saved_model.pbtxt’.
Welcome to the Tensorflow Forum!
Could you please provide standalone code to reproduce the issue described here?
Thank you!
It would also be good to know which version of TensorFlow you are using and if you updated it since the last time you used the model.
Hello Rajan!
I experienced the same error and had enormous problems with figuring it out. Since no-one answered your question yet, I decided to make an account here and hopefully help you get over this bump.
Myself I tried everything - from reinstalling my whole virtual env down to upgrading and downgrading each package. What finally worked was so simple that I cannot comprehend how I didn’t come up with it earlier.
What worked for me was following the specified path by the TypeError message and deleting the module folder. In your case you’ll have to go to 'C:\Users\rm\AppData\Local\Temp\tfhub_modules'. Then you will have to delete the ‘2c858e9d5fe42a1181c58c70d67244f7619f2ab2’ folder, but just in case make a copy of it.
When you load the saved model in your notebook, tf-hub will redownload the MobileNet model and everything should be back to normal!
Hope it works for you, have a nice day!