Tflite input data type (int8) conversion in javascript #2279
Replies: 5 comments
-
Posted at 2020-12-31 by @gfwilliams Hi - Probably what you want is just:
They don't exist in Espruino - you just get |
Beta Was this translation helpful? Give feedback.
-
Posted at 2020-12-31 by user122861 Hi @gfwilliams thanks for the reply |
Beta Was this translation helpful? Give feedback.
-
Posted at 2020-12-31 by @gfwilliams I'm not entirely sure it matters. Even if you specify a 4D array, I believe internally Tensorflow flattens it into a 1D array which is what you see in Espruino, so it shouldn't matter too much. However, if you used a 1D array from the start, it might be less confusing as then it's very explicit what each part of the input represents |
Beta Was this translation helpful? Give feedback.
-
Posted at 2020-12-31 by user122861
This is my code and my model takes input as array i am always getting the same output when printed. I am pretty sure there is no problem in model as i loaded the tflite model and tested the output in my desktop and it is working fine. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2021-01-04 by @gfwilliams Maybe you could print the contents of The way you're doing |
Beta Was this translation helpful? Give feedback.
-
Posted at 2020-12-30 by user122861
I have a tflite model which expects the input to be in int8 datatype
I have loaded my data in the same shape as my model expects but when i print (tf.getInput()[0] ) it always shows zero even when input_array has values. I have encoded my model with base64. Can anyone help me out @gfwilliams please help me out here
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.
Beta Was this translation helpful? Give feedback.
All reactions