Getting error message using ml5js with p5js

the errors I got:

Uncaught TypeError: Cannot read property ‘split’ of undefined (: line 57)
model is loaded
Error: Failed to execute ‘texImage2D’ on ‘WebGL2RenderingContext’: The image element contains cross-origin data, and may not be loaded.

my code:

let mobilenet;
let img;

function modelLoaded(){

console.log(‘model is loaded’);
mobilenet.predict(img,gotresult);

}
function gotresult(error,result){
if(error){
console.error(error)

}else{
console.log(result);
}
}
function setup() {
createCanvas(400, 400);
img=createImg(‘birds/bird.png’);

mobilenet=ml5.imageClassifier(‘MobileNet’,modelLoaded)
}

function draw() {
background(220);
}

please tell me how do I work it out .

Hi,

Remember that it’s always useful to make a search on internet with the error message because it’s more likely that someone got the same issue :wink: :

Note : also try to format your code by using the </> button in the message editor, you can edit your original message to change that

Hope it helps!