Skip to content

Commit

Permalink
try this
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosuc3m committed Sep 30, 2024
1 parent ff30810 commit 1938cd7
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
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;

/**
Expand Down Expand Up @@ -135,8 +134,8 @@ void loadAndRunTf2() throws LoadEngineException, Exception {
// Create the input tensor with the nameand axes given by the rdf.yaml file
// and add it to the list of input tensors
Tensor<FloatType> inpTensor = Tensor.build("input_1", "bxyc", img1);
List<Tensor<T>> inputs = new ArrayList<Tensor<T>>();
inputs.add(Cast.unchecked(inpTensor));
List<Tensor<FloatType>> inputs = new ArrayList<Tensor<FloatType>>();
inputs.add(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.
Expand All @@ -145,8 +144,8 @@ void loadAndRunTf2() throws LoadEngineException, Exception {
// defining the dimensions and data type
Tensor<FloatType> outTensor0 = Tensor.buildBlankTensor(
"conv2d_19", "bxyc", new long[] {1, 512, 512, 3}, new FloatType());
List<Tensor<R>> outputs = new ArrayList<Tensor<R>>();
outputs.add((Tensor<R>) outTensor0);
List<Tensor<FloatType>> outputs = new ArrayList<Tensor<FloatType>>();
outputs.add(outTensor0);

// Run the model on the input tensors. THe output tensors
// will be rewritten with the result of the execution
Expand All @@ -165,7 +164,6 @@ void loadAndRunTf2() throws LoadEngineException, Exception {
* @throws LoadEngineException if there is any error loading an engine
* @throws Exception if there is any exception running the model
*/
@SuppressWarnings("unchecked")
public static <T extends RealType<T> & NativeType<T>, R extends RealType<R> & NativeType<R>>
void loadAndRunTf1() throws LoadEngineException, Exception {
// Tag for the DL framework (engine) that wants to be used
Expand Down

0 comments on commit 1938cd7

Please sign in to comment.