When I try to load a keras model using importKerasNetwork I get the following error (R2020A)
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Alexander Berardino
el 13 de Nov. de 2020
Editada: Alexander Berardino
el 17 de Nov. de 2020
When I try to load a keras model using importKerasNetwork I get the following error (this is in R2020A).
Brace indexing is not supported for variables of this type.
Error in nnet.internal.cnn.keras.readModelAndTrainingConfigs>iVerifyKerasBackend
(line 71)
if ~isequal(BackendCell{1}, 'tensorflow')
Error in nnet.internal.cnn.keras.readModelAndTrainingConfigs (line 8)
iVerifyKerasBackend(ConfigFile);
Error in nnet.internal.cnn.keras.importKerasNetwork (line 21)
[ModelConfig, TrainingConfig, KerasVersion] =
nnet.internal.cnn.keras.readModelAndTrainingConfigs(ConfigFile, Format);
Error in importKerasNetwork (line 91)
Network = nnet.internal.cnn.keras.importKerasNetwork(modelfile, varargin{:});
Error in LoadingEyetoneIntoMatlab (line 4)
net=importKerasNetwork(sprintf('%s%s', modelpath,networkname));
0 comentarios
Respuestas (1)
Sourabh Kondapaka
el 17 de Nov. de 2020
In the below line:
net=importKerasNetwork(sprintf('%s%s', modelpath,networkname));
Between the '%s' and '%s' , you'll need to add a '/' .
Although this is not an ideal approach, you can do something like this:
modelPath = fileparts(which(modelName));
net = importKerasnetwork([modelPath filesep modelName '.h5']); %Assuming your model has .h5 extension
To learn more about the functions used above, refer the following links:
1 comentario
Ver también
Categorías
Más información sobre Image Data Workflows en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!