TFLite Input help

I have a tf model that I’ve been using in python with numpy arrays, and I’m trying to convert it to mobile, but I’m having trouble. Does anyone have any tips on troubleshooting? The input in python is a 1,2000,1 3d numpy array and according to Netron it expects float32. I would imagine in memory this would just be a flat stream of bytes, but I guess maybe there is some conversion I’m missing. I’ve verified that my inputs are symmetric across platform, so I think it’s only how I’m providing the data to the model. I’m using Xamarin with the Xamarin.TensorFlow.Lite NuGet package. Any help is greatly appreciated.

For anyone who may find this in the future. I solved my problem by finally finding how to convert a C# 3dim array to the proper java object. This was hard to locate, so I will share my code that worked for me.

           // Input needs to be fed as expected 1xNx1 array
            // Finding the right way to wrap this was difficult
            // See the method at
            var inputArr = new float[1][][] { new float[inputPoints][] };
            for(int i = 0; i < inputPoints; i++) {
                inputArr[0][i] = new float[] { normalizedValues[i] };
            var input = Java.Lang.Object.FromArray(inputArr);

            int outputPoints = interpreter.GetOutputTensor(0).Shape()[1];
            var outputLocations = new float[1][][] { new float[outputPoints][] };
            for(int i = 0; i < outputPoints; i++) {
                outputLocations[0][i] = new float[] { 0.0F };
            var output = Java.Lang.Object.FromArray(outputLocations);
            int[] dims = new int[] { 1, inputPoints, 1 };
            interpreter.Run(input, output)

This post was flagged by the community and is temporarily hidden.