ml5js / ml5-library

Friendly machine learning for the web! 🤖
https://ml5js.org
Other
6.5k stars 901 forks source link

ml5.neuralNetwork classify return results[0].confidence = NaN #962

Open michal16295 opened 4 years ago

michal16295 commented 4 years ago

Hello, i'm following this tutorial https://www.youtube.com/watch?v=FYgYyq-xqAw&t=528s and getting an NaN in results[0].confidence

gotResult = (error, results) => { if (results[0].confidence > 0.7) { this.poseLabel = results[0].label.toUpperCase(); } console.log(results[0]); this.classifyPose(); };

joeyklee commented 4 years ago

Hi @michal16295 - Thanks for posting this question. Can you share additional code and/or context for this issue. It would be helpful for us to see the rest of your code in order to debug.

Thanks!

clod986 commented 4 years ago

I have the same issue using the code found on your tutorial

zhentaoo commented 4 years ago

I have the same issue using the code found on your tutorial image image image

hanleyweng commented 4 years ago

Same issue. Getting NaN confidences with a custom dataset. https://editor.p5js.org/hanleyweng/sketches/pRXlNix-P

Update: I solved the NaN issue in my case. I suspect(ed) that my data wasn't playing well with the normalizeData() function. After manually normalizing my data (in excel) beforehand, and removing any columns which had a value of 0.00 . That worked for me.

AbrarShahriar commented 4 years ago

Hello @joeyklee, can't this issue be solved with something other than a software approach?

jinsel commented 4 years ago

I recommend looking the ml5 documentation https://www.bookstack.cn/read/ml5js/24b0850e81e4a479.md

MirrorHuang commented 4 years ago

I have the same issue using the code in https://learn.ml5js.org/#/reference/neural-network

josfaber commented 4 years ago

Same issue here with the default example and ml5 v0.4.3: codepen reproduction