MATLAB: Keras TensorFlow importer: can’t upload weights from .h5 file using importKerasNetwork.

deep learningDeep Learning ToolboximportkerasnetworkMATLABtoolbox

Hi, I have a .h5 file with a Keras TensorFlow model that was built using Sequential API. The model is carrying weights, and though Layers are being succesfully uploaded through importKerasNetwork() function, I can't seem to upload the weights with it.
What could I be doing wrong? Is there a way to debug this issue?
I tried this:
test_1=importKerasNetwork('myFile.h5')
And
test_2=importKerasNetwork('myFile.h5', 'WeightFile', 'myFile.h5')
No success whatsover.
Would it be recommendable to have the layers in an JSON file and the weights in a .h5 file?
Thanks in advance for all the help.

Best Answer

It works for me when I use the latest R2018b update of the tensorflow-keras importer. What version of MATLAB are you using? And do you get an error message?
I get the attached network in MATLAB.
Related Question