Skip to content
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

Attempting to load SegFormer preset "segformer_b0_imagenet" results in 403 error #2459

Open
luca-mala opened this issue Jun 25, 2024 · 4 comments

Comments

@luca-mala
Copy link

Current Behavior:

Downloading from https://www.kaggle.com/api/v1/models/keras/segformer/keras/segformer_b0_imagenet/2/download/config.json...
---------------------------------------------------------------------------
HTTPError                                 Traceback (most recent call last)
[/usr/local/lib/python3.10/dist-packages/kagglehub/exceptions.py](https://localhost:8080/#) in kaggle_api_raise_for_status(response, resource_handle)
     57     try:
---> 58         response.raise_for_status()
     59     except requests.HTTPError as e:

10 frames
HTTPError: 403 Client Error: Forbidden for url: https://www.kaggle.com/api/v1/models/keras/segformer/keras/segformer_b0_imagenet/2/download/config.json

Expected Behavior:

Model preset should load just fine.

Steps To Reproduce:

Execute the provided code:

model = keras_cv.models.SegFormer.from_preset(
      "segformer_b0_imagenet",
      num_classes=NUM_CLASSES,
      input_shape=(224,224,3),
      load_weights=True
  )

Gist:
https://colab.research.google.com/gist/luca-mala/c5625210cb4c46217fdd50cf85447374/untitled1.ipynb

Version:

0.9.0

Anything else:

Please note that the provided config.json is empty to begin with. You can check for yourself by downloading from the original Kaggle URL.

@Satge96
Copy link

Satge96 commented Aug 9, 2024

I have the same issue. Were you able to resolve it?

@luca-mala
Copy link
Author

I have the same issue. Were you able to resolve it?

Nope. I ended up switching to another framework.

@mehtamansi29 mehtamansi29 added the type:Bug Something isn't working label Sep 17, 2024
@sachinprasadhs
Copy link
Collaborator

Thanks for reporting the issue.

SegFormer with the new implementation is now part of KerasHub a consolidated KerasNLP and KerasCV package.
The model weights are available in Kaggle, for details and usage refer https://github.com/keras-team/keras-hub/blob/master/keras_hub/src/models/segformer/segformer_image_segmenter.py

We will not be making any changes to the models in KerasCV which are made available in KerasHub or the APIs/Utils made available in Keras.
If you still face any issue, please file a new issue in keras-hub

Copy link

This issue is stale because it has been open for 14 days with no activity. It will be closed if no further activity occurs. Thank you.

@github-actions github-actions bot added the stale label Dec 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants