I am trying to create a app that uses tensorflow model. My app crashes when inputFeature0.loadBuffer(byteBuffer) gets executed. ( got to know by commenting the lines)
var img=Bitmap.createScaledBitmap(bmp,229,229,true)
val model = SkinDiseasesDetectionFitSizeFinal24120210504.newInstance(this)
val inputFeature0 = TensorBuffer.createFixedSize(intArrayOf(1, 229, 229, 3), DataType.FLOAT32)
var tensorimage=TensorImage.fromBitmap(img)
var byteBuffer=tensorimage.buffer
inputFeature0.loadBuffer(byteBuffer)
This is the error
FATAL EXCEPTION: main
Process: com.azsky.skincancerdetection, PID: 31954
java.lang.IllegalArgumentException: The size of byte buffer and the shape do not match.
Can someone help me out in this?