• Hi - tf.getInput() actually gives you a 1D array, so what you'd be doing with tf.getInput()[0] = input_array is casting input_array to a single integer and writing it to the first element.

    Probably what you want is just: tf.getInput().set(input_array)

    Also tflite has standard get_tensor and set_tensor functions in interpreter to set the input data in proper format. I cannot see those functions in banglejs after loading the tflite model.

    They don't exist in Espruino - you just get tf.getInput/Output that do the formatting for you. Right now there's no support for multiple tensors of different types - you just get access to the first input and output one

  • Hi @Gordon thanks for the reply
    so you mean my model input should be always a flat 1D array and then internal conversion should be made while creating model. Currently the my input_array is 4D array so can i directly input this to the model or should i recreate my model to take only 1D array inputs.

About

Avatar for user122861 @user122861 started