0

I'm trying to classify maize leaf diseases using a react native cli offline. l used teachable machine to train a simple machine learning model for 4 classes and have downloaded the tensorflow.js format model(model.json and weights.bin files).

I'm using this code to load my model from medium Google

const modelJSON = require('../assets/model.json');
const modelWeights = require('../assets/weights.bin');
const loadModel = async()=>{
//.ts: const loadModel = async ():Promise<void|tf.LayersModel>=>{
    const model = await tf.loadLayersModel(bundleResourceIO(modelJSON, modelWeights)
    ).catch((e)=>{
        console.log("[LOADING ERROR] info:",e)
    })
    return model
}

In doing so I'm getting this error

Error: Cannot find native module 'ExponentGLObjectManager', js engine: hermes at Jsonload (http://localhost:8081/index.bundle//&platform=android&dev=true&lazy=true&minify=false&app=com.bestproject&modulesOnly=false&runModule=true:314338:41)

I have tried different ways of loading the model but l had the same error message.

1 Answer 1

0

I have had the same error message when trying to load @tensorflow/tfjs in react-native. I switched the js engine from hermes to jsc by adding "expo": {..., "jsEngine": "jsc",} To my app.json file and rebuilding the project with expo. Appearelntly hermes has some compatibility issues with TensorFlow.js but I couldnt find any specifics.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.