diff --git a/src/main/java/io/bioimage/modelrunner/example/ExampleLoadTensorflow1Tensorflow2.java b/src/main/java/io/bioimage/modelrunner/example/ExampleLoadTensorflow1Tensorflow2.java index 08828a63..b6095c7f 100644 --- a/src/main/java/io/bioimage/modelrunner/example/ExampleLoadTensorflow1Tensorflow2.java +++ b/src/main/java/io/bioimage/modelrunner/example/ExampleLoadTensorflow1Tensorflow2.java @@ -40,6 +40,7 @@ import net.imglib2.type.NativeType; import net.imglib2.type.numeric.RealType; import net.imglib2.type.numeric.real.FloatType; +import net.imglib2.util.Cast; import net.imglib2.util.Util; /** @@ -135,7 +136,7 @@ void loadAndRunTf2() throws LoadEngineException, Exception { // and add it to the list of input tensors Tensor inpTensor = Tensor.build("input_1", "bxyc", img1); List> inputs = new ArrayList>(); - inputs.add((Tensor) inpTensor); + inputs.add(Cast.unchecked(inpTensor)); // Create the output tensors defined in the rdf.yaml file with their corresponding // name and axes and add them to the output list of tensors.