ml5js / ml5-library

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

"Feature Extractor Examples" from ml5.js website / TypeError: Failed to fetch #1483

Open hedlerhdm opened 1 month ago

hedlerhdm commented 1 month ago

p5.js version

1.9.1

What is your operating system?

Windows 11

Web browser and version

Chrome 123.0.6312.106

Actual Behavior

the FeatureExtractor Examples for the "p5 web editor" from the ml5.js website raise an error: TypeError: Failed to fetch.

Here are the Examples: FeatureExtractor_Image_Regression FeatureExtractor_Image_Classification

image

a couple of days ago, the examples worked perfecty fine.

davepagurek commented 1 month ago

This is the error in the console for me:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://www.kaggle.com/models/google/mobilenet-v1/frameworks/tfJs/variations/025-224-classification/versions/1/model.json?tfjs-format=file&tfhub-redirect=true. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 302.

Looks like Kaggle recently made some API changes on April 8, so maybe it's related to that?

hedlerhdm commented 1 month ago

Besides the "Feature Extractor Examples", other sample codes are also affected: FaceMesh, Hand Pose, Image Classification, etc.

jht9629-nyu commented 1 month ago

I see cross-origin error on these two p5js sketches. They worked fine a few weeks ago.

https://editor.p5js.org/ml5/sketches/Facemesh_Webcam

https://editor.p5js.org/ml5/sketches/Handpose_Webcam

Access to fetch at 'https://www.kaggle.com/models/mediapipe/facemesh/frameworks/tfJs/variations/default/versions/1/model.json?tfjs-format=file&tfhub-redirect=true' (redirected from 'https://tfhub.dev/mediapipe/tfjs-model/facemesh/1/default/1/model.json?tfjs-format=file') from origin 'https://preview.p5js.org' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

shiffman commented 1 month ago

Hi everyone! We are working on a new version of the ml5.js with more up-to-date models, the release is coming very soon! Please see the following for newer examples that you can use right now in the meantime!

New examples: https://editor.p5js.org/ml5/collections/pUzWMkdmE New library: https://unpkg.com/ml5@0.20.0-alpha.4/dist/ml5.min.js Temporary documentation: https://github.com/ml5js/ml5-next-gen/blob/main/documentation.md

Please file any issues in this repo: https://github.com/ml5js/ml5-next-gen

hedlerhdm commented 1 month ago

Thanks, Daniel! Your work is highly appreciated. Any chance to fix the problem anyway? I'm using ml5.js during ongoing lectures. Almost all examples are affected (e.g., feature extraction).

shiffman commented 1 month ago

Was this perhaps a temporary issue yesterday? Everything seems to be working for me, I tested the ones above as well as these three examples from my videos.

https://editor.p5js.org/codingtrain/sketches/qFZF7iDe https://editor.p5js.org/codingtrain/sketches/5A_TJHA1 https://editor.p5js.org/codingtrain/sketches/ULA97pJXR

jht9629-nyu commented 1 month ago

Working for me ok today.

These sketches now run OK: https://editor.p5js.org/ml5/sketches/Facemesh_Webcam https://editor.p5js.org/ml5/sketches/Handpose_Webcam

hedlerhdm commented 1 month ago

all examples are now working again. Maybe a temporary problem with Kaggle. Thanks anyway

devihall commented 1 month ago

Hey there! I can confirm this was a TensorFlow issue. I had raised this issue on their Github and they rolled out a fix. . They also provided some recommendations for how to avoid this in the future. See link attached.

https://github.com/tensorflow/hub/issues/904#issuecomment-2046088259