-
var model = require("Storage").read("mytfmodel");
var tf = require("tensorflow").create(2048, model);
tf.getInput()[0] = x;
tf.invoke();
print(tf.getOutput()[0]);Hi - Thx, this makes sense now once I saw it, am new to JS! However, it produces the below error. I've uploaded the same tfmodel file used with the gesture functions to the watch and named it
mytfmodel
Does this perhaps mean that the tfmodel file should be converted to a flat string? In that case, can that be done with JS?>Uncaught TypeError: Model is not a Flat String/ArrayBuffer at line 2 col 50 var tf = require("tensorflow").create(2048, model); ^ Uncaught Error: Cannot read property 'getInput' of undefined at line 3 col 3 tf.getInput()[0] = x; ^ Uncaught Error: Cannot read property 'invoke' of undefined at line 4 col 3 tf.invoke(); ^ Uncaught Error: Cannot read property 'getOutput' of undefined at line 5 col 9 print(tf.getOutput()[0]); ^ >
Hi - I think you can just load it from storage and use it as-is, like this?
Please let me know if you have issues though...