Tkay
Tkay

Reputation: 11

ERROR Error: Cannot find native module 'ExponentGLObjectManager', js engine: hermes

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.

Upvotes: 0

Views: 436

Answers (1)

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.

Upvotes: 0

Related Questions