-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: 403 CORS error -tfhub/imagenet/mobilenet. Issue was last night, resolved this morning. Occurred again 3/26 1:47pm est #904
Comments
Hi @devihall03, thanks for posting. Do you mind reproducing and sharing the HTTP Request-Response headers associated with your failed requests to Here are the instructions to find them on Chrome, but it may differ depending on your browser. Thanks! |
General: Response Headers: Request Headers: |
@KeijiBranshi Just got this same error again just now. What is going on??? It was working one minute and now its not! |
Hi @devihall03. Looked into this a little more. The logs output from your original post shows your client using two separate ports
Kaggle's servers previously just mirrored the requestor's origin in the response headers. I don't understand how, but your I just adjusted the CORS response header to be a |
@KeijiBranshi Was working great and it happened again! Just before an important demo! Is there anything that can be done to mitigate this??? |
http://localhost:4000/ is our local |
Hi, we're looking into this issue. Thanks for your patience. |
Hi. We rolled out a fix. But please keep up posted if you see this again. More info here: #908 (comment) Thanks! |
Apologies that this happened before an important demo. For situations like this, I'd highly recommend self-hosting the model on your site. You can download the model directly from Kaggle:
Alternatively, you can bundle TF.js models directly into your web apps: For more support on that, I'd recommend posting in the tensorflow repository since this repo is specifically for the Python tfhub client. |
What happened?
Around 9pm yesterday had an issue with imagenet/mobilenet_v1_025_224/classification/1/model.json
Webapp made api call to
https://storage.googleapis.com/tfjs-models/tfjs/mobilenet_v1_0.25_224/model.json
got redirected to
https://storage.googleapis.com/kagglesdsdata/models/1514/1807/model.json?X-Goog-Algorithm=GOOG4-RSA-SHA256&X-Goog-Credential=gcp-kaggle-com%40kaggle-161607.iam.gserviceaccount.com%2F20240322%2Fauto%2Fstorage%2Fgoog4_request&X-Goog-Date=20240322T025731Z&X-Goog-Expires=259200&X-Goog-SignedHeaders=host&X-Goog-Signature=032994d5e34eddcb4ba94f531ad298c332b7504d3f859395d160fd2088c5e6facad9cebddce7a9e112a1dacd2496bdbb73fbf5c3d63d8b814b8d90b7fceb864b0611dcf680b7b033347fd8a6260561a4576fb9d7c02a7da200f58b3e02ab7acae8d119efa5986fbd30b8fab0e7a383dafd7813aa6c791d9473733910341aad489dde24e6c5d3bab7139f3bde0abc6efa14811caa539b3e9b47be833102cf1d884c3c68268b9ec38332d81ff1a03803ed913ed70270f266b82eaa41bde697a1242f55648742ab33f4cf35bfa6d5e4a9c67c1b952fb3f6fa5d3c149a0bd6e6a5b83e3836b63d5b8dd7c779ffdee942e3bd6a17b5d7f86e19c0fed82bbde6e92650
Model did not load and console showed
error: Access to fetch at 'https://tfhub.dev/google/imagenet/mobilenet_v1_025_224/classification/1/model.json?tfjs-format=file' from origin 'http://127.0.0.1:5501' has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header has a value 'http://127.0.0.1:5500' that is not equal to the supplied origin. Have the server send the header with a valid value, or, if an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
IP address had not changed. Using the same device. One minute requesta and response was fine, next minute CORS error.
Relevant code
Relevant log output
tensorflow_hub Version
0.12.0 (latest stable release)
TensorFlow Version
2.8 (latest stable release)
Other libraries
ML5
P5
JQuery
Bootstrap
Python Version
3.x
OS
macOS
The text was updated successfully, but these errors were encountered: