Failed loading TensorFlow.js model with bundleResourceIO for React Native
See original GitHub issueTensorFlow.js version
"@tensorflow/tfjs": "^1.7.4",
"@tensorflow/tfjs-react-native": "^0.3.0",
Describe the problem or feature request
I used Custom Vision to create a model. I exported this to TensorFlow.js for my React Native expo app.
// Get reference to bundled model assets
const modelJson = require('../assets/model/model.json');
const modelWeights = require('../assets/model/weights.bin');
// Use the bundleResourceIO IOHandler to load the model
const model = await tf.loadLayersModel(bundleResourceIO(
modelJson, modelWeights));
I am getting at modelJson this message Argument type {modelTopology: {node: *, library: {}, versions: {}}, weightsManifest: *} is not assignable to parameter type io.ModelJSON
When i catch the error if says layer: Improper config format
Does anybody now how to fix this?
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
reactjs - Failed loading custom TensorFlow.js model with ...
I am trying to load a custom model into tensorflow.js in react native but am getting the error below when I try to...
Read more >Bug help! With tfjs : r/reactnative - Reddit
Hi, I'm new to React Native and trying to load a model using ... bundleResourceIO } from '@tensorflow/tfjs-react-native' import {modelJSON} ...
Read more >tf.io.RequestDetails - TensorFlow.js React Native API
This IOHandler only supports load . It is designed to support loading models that have been statically bundled (at compile time) with an...
Read more >tensorflow/tfjs-react-native v0.8.0 - npm.io
Loading local models using bundleResourceIO. You can instead load models from a webserver. Step 1. Create your react native app. You can use...
Read more >[Solved]-Failed loading custom TensorFlow.js model with ...
Coding example for the question Failed loading custom TensorFlow.js model with bundleResourceIO for React Native-React Native.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
General help/advice questions are better suited to stack overflow. I’ll also leave a link to our tutorials page, having a good understanding of the concepts covered in the tutorials will be useful. There are also blog posts and other online resources describing how to do image classification in tfjs and using tfjs-react-native. Between those and the docs there should be something helpful.
Your model.json looks like a graph model, try using
tf.loadGraphModel
.