MATLAB Answers

Error when importing trained Keras network

12 ビュー (過去 30 日間)
Cyrus WaChong
Cyrus WaChong 2019 年 9 月 25 日
コメント済み: Cyrus WaChong 2019 年 10 月 1 日
I'm currently training a U-Net network in keras to segment images. The original run through with 2000 image and 5 epochs imports as an "h5" file and can run inference, but when I re-import into keras and retrain for another 3 epochs, when I try to import the h5 file back into MATLAB, I get the following error:
Error using importKerasNetwork (line 94)
Expected input to be positive.
Error in test (line 1)
LFUNET = importKerasNetwork('model_next.h5');
What exactly does this error mean? I'm not very sure what is means that my h5 file is negative. These files are much larger than

  0 件のコメント

サインイン to comment.

採用された回答

Shashank Gupta
Shashank Gupta 2019 年 10 月 1 日
編集済み: Shashank Gupta 2019 年 10 月 1 日
Hi Cyrus,
This is an MException error, generally occur when an inappropriate identifier has been passed to the function. Following things may help
  1. Check if the input arguments passed are correct.
  2. Verify the location of “model_next.h5” file.
  3. Verify the activation and layer used in the model, this function only supports most common used layer, Kindly cross verify them from the following link.
You can go through the importKerasNetwork.m script to know more about the function and error handling.
I hope this helps.

  1 件のコメント

Cyrus WaChong
Cyrus WaChong 2019 年 10 月 1 日
Thank you so much for your help Shashank!

サインイン to comment.

その他の回答 (0 件)

サインイン してこの質問に回答します。

タグ

製品


リリース

R2019b

Translated by