ML5 is a Javascript Machine Learning library built on top of Tensorflow.js
Questions tagged [ml5.js]
55 questions
1
vote
1 answer
Error in oneHot: depth must be >=2, but it is 1
So I was working with ml5 in js on a simple NeuralNetwork that was going to be trained by images using the p5 js lib to get the images into a array and then train them through ml5, But I ran into a major issue that I have been spending hours looking…

Helix Foreal
- 11
- 2
1
vote
2 answers
How do I add p5.sound to React using react-p5-wrapper?
I'm trying to get figure how I can include p5.sound to my p5 Sketch.
Currently I'm using react-p5-wrapper https://github.com/and-who/react-p5-wrapper/ to get p5 into React.
There's a similar issue raised in the repo and I've asked the same question…

Vennsoh
- 4,853
- 5
- 26
- 41
1
vote
0 answers
JAVASCRIPT: ml5.js: Initialization of backend webgl failed t.initializeBackend @ tf-core.esm.js:17
I get this 'warning' (running on the cpu because you couldn't use the gpu is a bit of a step up from 'warning yellow'... much more of a 'danger orange' if you ask me) when trying to run the following code:
…

altruios
- 986
- 1
- 10
- 29
1
vote
0 answers
Training of ml5.js model does not start
I try to predict stock prices with a LSTM layer.
Here's the code:
var options = {
task: "regression",
debug: true,
inputs: ["date", "timevalue"],
outputs: ["price", "timevalue"],
layers: [
{
type:…

Alex
- 163
- 2
- 15
1
vote
1 answer
ml5 Error: pixels passed to tf.browser.fromPixels() can not be null
I have created a very simple script with p5.js and ml5.js as per this tutorial.
In the setup function, upon clicking on a button, I am adding images to the classifier. However, when I click on the button, I get the pixels error. This is how my…
user13067694
1
vote
1 answer
ML5, sentiment analysis: Uncaught (in promise) TypeError: Cannot read property 'the' of undefined
I am trying to assess sentiment of a book using ML5 sentiment api:
const sentiment = ml5.sentiment('movieReviews', modelReady)
// When the model is loaded
function modelReady() {
// model is ready
console.log("Model Loaded!");
}
// make the…

Nikita Vlasenko
- 4,004
- 7
- 47
- 87
1
vote
1 answer
How to Stop/Terminate ML5 Posenet
Creating an app and want to stop Posenet when its job is done
private sketch(p: any) {
p.setup = () => {
this.poseNet = ml5.poseNet(p.createCapture(p.VIDEO), {
outputStride: 8
});
…

Felix Brüggemann
- 21
- 3
1
vote
1 answer
Mobile camera Access through p5js
I recently started using imageclassifier() in p5js but when opened using mobile i.e Localhost .It dosent open camera should i be using a different method or some config is required.

Sai_Charan_Seri
- 57
- 4
1
vote
1 answer
createImage() vs createImg() vs loadImage() in p5. which to use to load in an array of images for use in ml5?
I am attempting to piece together an example from ml5 on image style transfer (https://ml5js.org/docs/style-transfer-image-example) with p5.js examples parsing a JSON of image URLs, and adding them to an array to display as images. I am hitting a…

Coffeecoffeecoffee
- 31
- 1
- 4
0
votes
0 answers
ml5.js tf.js featureExtractor addImage memory leak WebGL: CONTEXT_LOST_WEBGL: loseContext: context lost
images resolution is 100x100, on image ~900 (based on memory load) screen become black and error appear:
Couldn't parse line number in error:
WebGL: CONTEXT_LOST_WEBGL: loseContext: context lost
…

ale24
- 1
- 2
0
votes
0 answers
ml5.js error when creating a neural network
I'm following this tutorial: https://www.youtube.com/watch?v=3MqJzMvHE3E&t=480s on shape classification and I'm encountering the problem
Uncaught Error: Error in oneHot: depth must be >=2, but it is 1
at oneHot_ (tf-core.esm.js:17:357944)
at…

Yosseuf
- 1
0
votes
0 answers
ML5.js wrong predict for a basic linear regression
I am a beginner at the neural network. Trying to recreate some basic predict for the formula y = 2x-1 from the tensorflow.js tutorial using ml5.js but something is getting wrong. Here is my code:
const model = ml5.neuralNetwork({
task:…
0
votes
0 answers
how to put an accuracy graph on the ml5.js?
I am using the ml5.js to learn machine learning, so I want to now how to put an accuracy graph on the ml5.js? I am building a neural network.
I used ml5.neuralNetwork with the debug options as true, but I only have the loss graph.

Daniel
- 1
0
votes
1 answer
How to stop sound classification in ml5.js
Is it possible to programmatically stop sound classification process? I don't find any method or function to do it.
Ex:
const classifier = ml5.soundClassifier('path/to/model.json', options, modelReadyCallback);
// start…

molnargabor
- 13
- 3
0
votes
0 answers
Uncaught (in promise) TypeError: e is not a function
I cannot seem to diagnose any issue in my code yet after 9 epochs of training I get the error in the title.
Here is the code that stores values inside the posenet listener callback
if (poses.length > 0) {
pose = poses[0].pose;
…

50NNY1
- 1