-
-
I managed to load it to the Bangle.js, there were two issues:
- Apparently base64.b64encode(tflite_model) wasn't working in my base64 version, it was giving a corrupted string, I had to create it with base64.b64encode(tflite_model).decode('utf-8')
- I had to change the conv1d layers to conv2d layers, otherwise there was a different error.
The problem is now that the model does not seem to take any values as inputs. I trained the model with inputs in shape (1, 12, 3, 1), so I've prepared the data in the bangle in the same format: the input for one prediction is of shape (1, 12, 3, 1) that is, an array of arrays.
But when I execute the following commands the input has been assigned all to NaN.**print(input); tf.getInput().set(input); print(tf.getInput());**
- Apparently base64.b64encode(tflite_model) wasn't working in my base64 version, it was giving a corrupted string, I had to create it with base64.b64encode(tflite_model).decode('utf-8')
-
Hi @Gordon, thank you for your reply.
My Tensorflow version is the latest one tf.version Out[1]: '2.5.0', I'm attaching the model configuration in a screenshot and also the information provided when running the model, I don't see anything strange but I might be missing something?I've tried the tool that you recommended but I couldn't make it work, it keeps giving errors (also screenshot attached).
I'd appreciate any help. Thanks!
-
I have created a Tensorflow model that expects a (1, 12, 3) sample as input. I converted it to Tensorflow Lite and print the declaration as in the example provided in a tutorial in this forum:
print("var model=atob(\""+str(base64.b64encode(model_no_quant_tflite))+"\");")
I'm using quantization because it wasn't reducing any further the size, the size of the model I'm using is 4356 bytes .Here the problem, the command "var tf = require("tensorflow").create(2048, model);" keeps giving an error "Uncaught Error: Model provided is schema version 0 not equal to supported version 3." when I try to load it to the Emulator (loading to the watch also fails, it even disconnects the Bluetooth half loading and the loading fails).
Do you know what could be the cause of the error?
Thank you very much.
Hello @ThomasVikström !
Great to hear that is not crushing. The structure looks pretty much like mine, the minor differences are: