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

2 ビュー (過去 30 日間)
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.
  5 件のコメント
Don Mathis
Don Mathis 2019 年 2 月 26 日
Darci, if you're using R2018b, you can download the latest version of the keras importer. There was an update in the last month or so. 'binary_crossentropy' is supported now. The placeholder layers should contain the weights, inside the KerasConfiguration field. Unfortunately, Conv1D is not yet supported by the importer.
José Luis Sandoval
José Luis Sandoval 2020 年 5 月 24 日
I have a similar problem:
>> detetor
Warning: File 'resnet50_pascal_cards_inference.h5' was saved in Keras version '2.3.1'. Import of Keras versions newer than
'2.2.4' is not yet supported. The imported model may not exactly match the model saved in the Keras file.
Error using importKerasNetwork (line 94)
Unable to import network. Weight sharing is not yet supported.
Error in detetor (line 65)
net = importKerasNetwork(modelfile,'OutputLayerType','classification','ClassNames',classNames);

サインインしてコメントする。

採用された回答

Don Mathis
Don Mathis 2019 年 2 月 8 日
編集済み: Don Mathis 2019 年 2 月 8 日
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.
  6 件のコメント
Gopal Rao Netrakanti
Gopal Rao Netrakanti 2020 年 11 月 9 日
Should we revert to R2018b (doesn't make sense)? I am having the same error in 2019b.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImage Data Workflows についてさらに検索

製品


リリース

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by