Not able to load the exported MATLAB DL model in TensorFlow
I have use exportNetwork command and got a folder named myModel which contains 4 files init.py, readme.txt, model.py, and weights.h5.
No according to matlab documentation: myModel folder is a package. So we can do
"import myModel
model = myModel.load_model()"
But if i am doing this i am getting error: "ModuleNotFoundError: No module named ‘myModel’"
I am running on colab so what i did is: i uploaded the myModel folder in my drive and then i mounted drive. But not able to install that package. How to load such exported model in python please tell us clearly.
I have tried to make the model using ‘model.py’ code. But then when i am trying to load the weights using kers command:
model = create_model()
weight_path=’/content/drive/MyDrive/VGGish_Arka/weights.h5′
model.load_weights(weight_path)
Error is: "ValueError: Layer count mismatch when loading weights from file. Model expected 9 layers, found 0 saved layers."I have use exportNetwork command and got a folder named myModel which contains 4 files init.py, readme.txt, model.py, and weights.h5.
No according to matlab documentation: myModel folder is a package. So we can do
"import myModel
model = myModel.load_model()"
But if i am doing this i am getting error: "ModuleNotFoundError: No module named ‘myModel’"
I am running on colab so what i did is: i uploaded the myModel folder in my drive and then i mounted drive. But not able to install that package. How to load such exported model in python please tell us clearly.
I have tried to make the model using ‘model.py’ code. But then when i am trying to load the weights using kers command:
model = create_model()
weight_path=’/content/drive/MyDrive/VGGish_Arka/weights.h5′
model.load_weights(weight_path)
Error is: "ValueError: Layer count mismatch when loading weights from file. Model expected 9 layers, found 0 saved layers." I have use exportNetwork command and got a folder named myModel which contains 4 files init.py, readme.txt, model.py, and weights.h5.
No according to matlab documentation: myModel folder is a package. So we can do
"import myModel
model = myModel.load_model()"
But if i am doing this i am getting error: "ModuleNotFoundError: No module named ‘myModel’"
I am running on colab so what i did is: i uploaded the myModel folder in my drive and then i mounted drive. But not able to install that package. How to load such exported model in python please tell us clearly.
I have tried to make the model using ‘model.py’ code. But then when i am trying to load the weights using kers command:
model = create_model()
weight_path=’/content/drive/MyDrive/VGGish_Arka/weights.h5′
model.load_weights(weight_path)
Error is: "ValueError: Layer count mismatch when loading weights from file. Model expected 9 layers, found 0 saved layers." deep learning, exportnetwork, vggish, audio, tensorflow MATLAB Answers — New Questions