hub icon indicating copy to clipboard operation
hub copied to clipboard

Bug: sudden 403 for certain models

Open Zainking opened this issue 3 months ago • 8 comments

What happened?

What happened? Attempting to get following models:

  • https://tfhub.dev/tensorflow/tfjs-model/blazeface
  • https://tfhub.dev/mediapipe/tfjs-model/facemesh
  • https://tfhub.dev/mediapipe/tfjs-model/iris but getting 403 and CORS errors on GET.

Relevant code

curl --location 'https://tfhub.dev/tensorflow/tfjs-model/blazeface/1/default/1/model.json?tfjs-format=file' \
--header 'authority: tfhub.dev' \
--header 'accept: */*' \
--header 'accept-language: en-US,en;q=0.9' \
--header 'cache-control: no-cache' \
--header 'origin: http://localhost:4200' \
--header 'pragma: no-cache' \
--header 'referer: http://localhost:4200/' \
--header 'sec-ch-ua: "Not.A/Brand";v="8", "Chromium";v="114", "Brave";v="114"' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-ch-ua-platform: "macOS"' \
--header 'sec-fetch-dest: empty' \
--header 'sec-fetch-mode: cors' \
--header 'sec-gpc: 1' \
--header 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36'

Relevant log output

<?xml version='1.0' encoding='UTF-8'?><Error><Code>SignatureDoesNotMatch</Code><Message>Access denied.</Message><Details>The request signature we calculated does not match the signature you provided. Check your Google secret key and signing method.</Details><StringToSign>GOOG4-RSA-SHA256
20251009T150044Z
20251009/auto/storage/goog4_request
0b9de6546c08cc785b829a51e4366ddd9c3d2b872e0c2078475fc93d0574a2e1</StringToSign><CanonicalRequest>GET
/kagglesdsdata/models/2379/3196/model.json
X-Goog-Algorithm=GOOG4-RSA-SHA256&amp;X-Goog-Credential=gcp-kaggle-com%40kaggle-161607.iam.gserviceaccount.com%2F20251009%2Fauto%2Fstorage%2Fgoog4_request&amp;X-Goog-Date=20251009T150044Z&amp;X-Goog-Expires=259200&amp;X-Goog-SignedHeaders=host
host:storage.googleapis.com

tensorflow_hub Version

0.13.0.dev (unstable development build)

TensorFlow Version

2.8 (latest stable release)

Other libraries

No response

Python Version

3.x

OS

macOS

Zainking avatar Oct 12 '25 13:10 Zainking

I am also suddenly getting HTTPError: HTTP Error 403: Forbidden when trying to get the pool_3 layer of the inception model to calculate FID scores. Here are the relevant parts of the code that is crashing now:

INCEPTION_TFHUB = 'https://tfhub.dev/tensorflow/tfgan/eval/inception/1'
INCEPTION_FINAL_POOL = 'pool_3'

# rescale pixels between [-1 1]
images = 2.*images - 1.

generated_images_list = tf.split(images, num_or_size_splits = num_splits)

activations = tf.nest.map_structure(tf.stop_gradient, tf.map_fn(
                        fn = tfgan.eval.classifier_fn_from_tfhub(INCEPTION_TFHUB, INCEPTION_FINAL_POOL, True),
                        elems = tf.stack(generated_images_list),
                        parallel_iterations = 10,
                        swap_memory = True,
                        name = 'RunClassifier'))

activations = tf.concat(tf.unstack(activations), 0)

rogelioamancisidor avatar Oct 12 '25 15:10 rogelioamancisidor

+1

Here is the temporary fix that worked for me with tflite_model_maker: Download the model from TF/Kaggle, point the model_spec to the local path.

  1. Download model (bash)
curl -L -o /model.tar.gz https://www.kaggle.com/api/v1/models/tensorflow/efficientdet/tensorFlow2/lite1-feature-vector/1/download
mkdir /model_dl
tar -xvf /model.tar.gz -C /model_dl
  1. Overwrite model spec URI (Python)
spec = model_spec.get('efficientdet_lite1')
spec.uri = "/model_dl"

flrs avatar Oct 12 '25 16:10 flrs

+1, also happening with https://tfhub.dev/tensorflow/tfjs-model/ar_portrait_depth/1/model.json?tfjs-format=file

nasif-co avatar Oct 20 '25 04:10 nasif-co

+1 this is also happening with https://tfhub.dev/google/tfjs-model/movenet/singlepose/lightning/4/model.json?tfjs-format=file

adm-marklauyq avatar Oct 20 '25 15:10 adm-marklauyq

Hi all, thank you for flagging this issue! We're looking into it now.

KeijiBranshi avatar Oct 20 '25 17:10 KeijiBranshi

Hi all. We pushed out some fixes and are seeing the 403s drop from our end. We think those model links should work now, but please let us know otherwise.

KeijiBranshi avatar Oct 20 '25 22:10 KeijiBranshi

It's working again ;-) Thanks KeijiBranshi and the team for the quick response. I think you saved the a**** of a lot of people relying on these links. Appreciated!!!

kempermo avatar Oct 21 '25 04:10 kempermo

Thank you so much!

steam228 avatar Oct 21 '25 08:10 steam228