Comments (6)
from ml5-library.
React stack traces are the worst. All I can tell is that somewhere inside classifyInternal
(or any of the functions that it calls) there is an Object.keys(something)
on a something
which is not an object.
The only top-level Object.keys
are on meta.inputs
and meta.outputs
. I don't know how those could be undefined
but humor me and add some extra logging. The line we're looking for might be something else really deep in the tree and hard to find.
const classifyPose = async () => {
try {
if (pose && skeleton.length) {
let inputs = []
for (let i = 0; i < pose.keypoints.length; i++) {
let x = pose.keypoints[i].position.x
let y = pose.keypoints[i].position.y
inputs.push(x)
inputs.push(y)
}
console.log('Inputs', inputs);
const meta = brainRef.current.neuralNetworkData.meta;
console.log('Meta', meta);
console.log('meta.inputs', meta.inputs);
console.log('meta.outputs', meta.outputs);
const results = await brainRef.current.classify(inputs);
gotResults(undefined, results);
} else {
// console.log('Pose not found')
setCurrPose('Not found')
posesArray.current = [...posesArray.current, null]
}
handleGameTik()
} catch(e) {
console.log('Caught error', e);
console.trace();
}
}
from ml5-library.
from ml5-library.
Okay we are getting somewhere! You’ve confirmed that meta.inputs and meta.outputs are both undefined and that’s what triggers the TypeError.
In looking at your meta object I can see that the info which we need is there but it’s not in the right place. It looks like it’s meta.meta.inputs instead of meta.inputs.
I haven’t got to the root problem yet. That is, why the meta is structured incorrectly. I’ll need to play around more and run your code. It’s either a problem with reading your metadata.json file or it’s a problem with exporting the model which led to an incorrect metadata.json. There probably exists a quick fix where I tell you what to change in the metadata.json file to make it work but that’s a poor solution that doesn’t address why it’s wrong. Did you use ml5 to generate the saved model that you are loading?
from ml5-library.
from ml5-library.
from ml5-library.
Related Issues (20)
- DOMException: Failed to execute 'texImage2D' on 'WebGL2RenderingContext': Tainted canvases may not be loaded. HOT 1
- knnClassifier result after .save() and .load() - classIndex becomes undefined and label becomes number, labelToClassId disappears HOT 1
- memory leak in featureExtractor on addImage in WebGL backend HOT 3
- ML5 fails to load on Chrome incognito - localstorage error HOT 1
- about use ml5 in vue HOT 1
- How should we handle input data with Nulls/Blanks? HOT 1
- Always outputting the same thing. Might be something wrong with my HTML not sure HOT 2
- add facemesh and handpose to preload
- Possible memory leak in BodyPix and WEBGL
- Various problems with the training-charRNN repo
- Problem with CORS HOT 1
- model topology missing handpose regression HOT 9
- ERR_CONNECTION_REFUSED
- New m15 Coder, couldn't find answer online, Error "Error in oneHot: depth must be >=2, but it is 1" HOT 1
- "Feature Extractor Examples" from ml5.js website / TypeError: Failed to fetch HOT 9
- Need some information on using NeuralNetworkVis HOT 4
- Fetch data from GitHub repo as JSON doesn't work HOT 1
- Feature Request- open up dovalidation and validationData property on FeatureExtractor class HOT 1
- custom
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ml5-library.