Issue Importing Trained Keras Model (UNet) from Python to MATLAB

Viewed 46

I am trying to import a model from Keras to MATLAB. I am unable to create the variable containing the model.

modelfile = '4k_mag_run1.h5'; 
net =importKerasNetwork(modelfile, 'WeightFile', modelfile,'ImageInputSize',[256,256]);

The model is a version of the UNet model which I have trained myself and is being used for semantic segmentation. The error message recieved is:

Error using importKerasNetwork (line 94)
The value of 'TrainedVariance' is invalid. Expected input to be positive.
Error in Classify_LT (line 3)
net =importKerasNetwork(modelfile, 'WeightFile', modelfile,'ImageInputSize',[256,256]);
0 Answers
Related