Hi, everyone!
I’m new to TensorFlow and I’m trying to use it in a CLI React Native application. I’ve tried both coco-ssd and mobilenet and both give the same error on load(). I provided some code below.
I’m not sure what I could do at this point, I’ve been stuck with this for 2 days. Any help is appreciated, thanks!
import React from "react";
import { useState, useEffect } from "react";
import * as cocoSsd from "@tensorflow-models/coco-ssd";
import * as tf from "@tensorflow/tfjs";
const App = () => {
const [model, setModel] = useState<cocoSsd.ObjectDetection>()
const loadModel = async () => {
try {
const model = await cocoSsd.load();
setModel(model);
console.log("model loaded");
} catch (err) {
console.log(err);
console.log("failed to load model");
}
}
useEffect(() => {
tf.ready().then(() => {
loadModel();
});
}, []);
}
from package.json:
"@tensorflow-models/coco-ssd": "^2.2.2",
"@tensorflow/tfjs": "^4.2.0",