0

I trained a fully convolutional network to transform an image into another image of the same resolution. i was able to convert it into a .tflite model and load it in my android app. I create an interpreter and can set the inputsize by calling

interpreter.resizeInput(0, new int[] {1, image_size, image_size, 3});

but when i use interpreter.run(input,output); it breaks with the message

Cannot copy from a TensorFlowLite tensor (StatefulPartitionedCall:0) with shape [1, 1, 1, 3] to a Java object with shape [1, 1024, 1024, 3].

the output shape should be [1, 1024, 1024, 3] but it isn't.

interpreter.getOutputTensor(0).shapeSignature() and
interpreter.getInputTensor(0).shapeSignature()

return [-1, -1, -1, 3] but i can't change the actual shape you get from

interpreter.getOutputTensor(0).shape()

the way i did with the input by using interpreter.resizeInput(0, new int[] {1, image_size, image_size, 3});

is there a way to implement a tflitemodel that transformes images of variable resolution into other images of the same resolution somehow? I am pretty sure it works before i convert it to tflite

spam junk
  • 71
  • 1
  • 2
  • 9
  • If the model is working before converting in .tflite then the issue should be on how you convert it to .tflite. What script you are using ? – Notron Feb 07 '23 at 14:01

0 Answers0