Hi All
I have to follow this video of @khanhlvg to train a model to detect a custom object but I don’t know how to use this model on the web browser. I have tried this code but unluckily it got the error. Is there anyone who can let me know what is wrong with it.
Here is my code
const model = await tfTask.ObjectDetection.CustomModel.TFLite.load({
model:
'android.tflite',
});
// Run inference on an image.
const img = document.querySelector('img');
const result = await model.predict(img);
console.log(result.objects);
// Clean up.
model.cleanUp();
And here is the error
Error: Failed to create ObjectDetector: INVALID_ARGUMENT: Output tensor at index 0 is expected to have 3 dimensions, found 2. [tflite::support::TfLiteSupportStatus='400']
Thanks,
Truong