I am trying to reuse with tensorflowjs models created by tensorflow. In order to understand how the converter works I have tried to convert the mobilenetv2 model:
tensorflowjs_converter --input_format=tf_hub --output_format=tensorflowjs 'https://tfhub.dev/google/imagenet/mobilenet_v2_050_224/classification/2' ./web_model
That seems to work. Then I have tried to used this new converted model within the mobilenet demo by changing the way the model is loaded:
// const model = await mobilenet.load({version, alpha});
// replaced by
const model = await mobilenet.load({ modelUrl: './web_model/model.json', version, alpha, inputRange: [0, 1], fromTFHub: true });
// Classify the image.
const predictions = await model.classify(img);
The classify call triggers an error:
Uncaught (in promise) Error: Activation relu6 has not been implemented for the WebGL backend.
I have no clue on how the official tensorflowjs mobilenet model has been generated :(
fromTFhub
property - edkeveked