errors on adding images in FeatureExtractor_Image_Classification
pmcheng opened this issue · comments
Hello,
I'm getting errors when trying to add webcam images for either the FeatureExtractor_Image_Classification or FeatureExtractor_Image_Regression demos, both the p5js and javascript versions. The webcam displays in the canvas fine, but when I click on "Add Cat Image" in the classification demo, the console reports:
Uncaught (in promise) Error: pixels passed to tf.fromPixels() can not be null
at e.fromPixels (tf-core.esm.js:17)
at e.fromPixels (tf-core.esm.js:17)
at fromPixels_ (tf-core.esm.js:17)
at Object.fromPixels (tf-core.esm.js:17)
at imageUtilities.js:67
at tf-core.esm.js:17
at e.scopedRun (tf-core.esm.js:17)
at e.tidy (tf-core.esm.js:17)
at Object.t.tidy (tf-core.esm.js:17)
at t.imgToTensor (imageUtilities.js:66)
No images are added (when I click Train, I get "Error: Add some examples before training!")
This also happens to me for the online demos on the ml5 web site, https://ml5js.org/docs/custom-classifier and https://ml5js.org/docs/custom-regression
I see the problem on both Firefox and Chrome on Windows 7, using python -m http.server. Of note, the KNNClassification_Video demo does work for me.
Not sure but may be related to ml5js/ml5-library#260
Chrome now works for me with update to v. 72 (sorry I didn't keep track of the version I was using previously). Firefox gives a "getUserMedia not supported in this browser" exception, but this may be related to a p5 issue (processing/p5.js#3210). I will close this issue.