Skip to content
Snippets Groups Projects
Commit 0fb07d47 authored by carlosuc3m's avatar carlosuc3m
Browse files

add exception throw when the model fails

parent cf735b8d
No related branches found
No related tags found
No related merge requests found
......@@ -69,14 +69,11 @@ public class Tensorflow1Interface implements DeepLearningInterface
public void loadModel(String modelFolder, String modelSource) throws LoadModelException {
model = SavedModelBundle.load(modelFolder, "serve");
byte[] byteGraph = model.metaGraphDef();
try
{
sig = MetaGraphDef.parseFrom(byteGraph).getSignatureDefOrThrow("serving_default");
}
catch (InvalidProtocolBufferException e)
{
System.out.println("Invalid graph");
}
try {
sig = MetaGraphDef.parseFrom(byteGraph).getSignatureDefOrThrow("serving_default");
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw new LoadModelException();
}
}
@Override
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment