ml5-library icon indicating copy to clipboard operation
ml5-library copied to clipboard

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

Open michal16295 opened this issue 5 years ago • 9 comments

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(); };

michal16295 avatar May 13 '20 15:05 michal16295

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!

joeyklee avatar May 20 '20 13:05 joeyklee

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

clod986 avatar Jun 16 '20 15:06 clod986

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

zhentaoo avatar Jul 24 '20 06:07 zhentaoo

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.

hanleyweng avatar Jul 27 '20 07:07 hanleyweng

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

AbrarShahriar avatar Aug 24 '20 09:08 AbrarShahriar

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

jinsel avatar Sep 27 '20 06:09 jinsel

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

MirrorHuang avatar Oct 13 '20 08:10 MirrorHuang

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

josfaber avatar Nov 03 '20 10:11 josfaber

Same issue here. I tried many different links to the ml5 and kept getting the same issue. https://editor.p5js.org/Kostas/sketches/OLDXRuOdu has a ml5.min.js without the issue but unfortunately I cannot find a way to copy it. Sure would be nice to have the version that solves the confidence issue. `

<!-- <script src="ml5.min.js" type="text/javascript"></script>-->`

was in the head tag for the index.html. Only using the locally referenced ml5.min.js gave a confidence interval. Wish I could get a copy!!

neillindstrom2 avatar Jun 04 '25 00:06 neillindstrom2