Input_tensor very is a very large int

Hello Community!

This post may be similar to this post, but there was no solution to this post.

I created a Keras model using the transfer learning tutorial. I then used the quantization and converter from the TinyML Book to produce an array of bytes for my Arduino nano sense with the ArduCam 2MP Plus camera.

Using this Arduino code example to test my board and camera, which worked. I then modified the byte array with my own. This gave me the error “Invoke() called after initialization failed”. Further investigation printing out “TF_LITE_REPORT_ERROR(error_reporter, “Bad input tensor, size. %d”, input->dims->size);” produced the value 2113404085. The same line with the original byte array produced 4.

Putting my tflite file into Netron showed my input to be (1, 240, 240, 3) shape with float32 data type.

Therefore I presume that my error is in the byte array. Can anyone shed some light on this, please?