Skip to content

Commit

Permalink
remove old interface and add javadoc to java worker
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosuc3m committed Oct 1, 2024
1 parent 5a5fe33 commit 9e84b85
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 864 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@ public class JavaWorker {
private final Tensorflow2Interface ti;

private boolean cancelRequested = false;


/**
* Method in the child process that is in charge of keeping the process open and calling the model load,
* model inference and model closing
* @param args
* args of the parent process
*/
public static void main(String[] args) {

try(Scanner scanner = new Scanner(System.in)){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public void loadModel(String modelFolder, String modelSource)
try {
checkModelUnzipped();
} catch (Exception e) {
throw new LoadModelException(e.toString());
throw new LoadModelException(Types.stackTrace(e));
}
model = SavedModelBundle.load(this.modelFolder, "serve");
byte[] byteGraph = model.metaGraphDef().toByteArray();
Expand All @@ -185,7 +185,7 @@ public void loadModel(String modelFolder, String modelSource)
"serving_default");
}
catch (InvalidProtocolBufferException e) {
System.out.println("Invalid graph");
throw new LoadModelException(Types.stackTrace(e));
}
}

Expand Down
Loading

0 comments on commit 9e84b85

Please sign in to comment.