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

close the session when closng the model to allow reloading

parent d309db20
No related branches found
No related tags found
No related merge requests found
...@@ -100,8 +100,6 @@ public class Tensorflow1Interface implements DeepLearningInterface ...@@ -100,8 +100,6 @@ public class Tensorflow1Interface implements DeepLearningInterface
// Fill the agnostic output tensors list with data from the inference result // Fill the agnostic output tensors list with data from the inference result
outputTensors = fillOutputTensors(resultPatchTensors, outputTensors); outputTensors = fillOutputTensors(resultPatchTensors, outputTensors);
// Close the remaining resources
session.close();
for (org.tensorflow.Tensor<?> tt : inTensors) { for (org.tensorflow.Tensor<?> tt : inTensors) {
tt.close(); tt.close();
} }
...@@ -134,6 +132,7 @@ public class Tensorflow1Interface implements DeepLearningInterface ...@@ -134,6 +132,7 @@ public class Tensorflow1Interface implements DeepLearningInterface
@Override @Override
public void closeModel() { public void closeModel() {
sig = null; sig = null;
model.session().close();
if (model != null) if (model != null)
model.close(); model.close();
model = null; model = null;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment