Skip to content

🚨🚨🚨 Remove softmax for EfficientNetForImageClassification 🚨🚨🚨#25501

Merged
amyeroberts merged 3 commits intohuggingface:mainfrom
amyeroberts:fix-efficientnet-softmax
Aug 14, 2023
Merged

🚨🚨🚨 Remove softmax for EfficientNetForImageClassification 🚨🚨🚨#25501
amyeroberts merged 3 commits intohuggingface:mainfrom
amyeroberts:fix-efficientnet-softmax

Conversation

@amyeroberts
Copy link
Contributor

What does this PR do?

/!\ This is a breaking change /!\

EfficientNet implementation erroneously added a softmax to the models logits in the classification head. This breaks with convention and documentation for the model outputs.

This results in the very small probabilities seen in the hosted widgets on the checkpoints pages, as the logits effectively have softmax applied twice.

image

Most of the efficientnet checkpoints were downloaded < 100 times in the past month. However, efficientnet-b7 is more popular with a few thousand downloads.

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?

@amyeroberts amyeroberts requested a review from sgugger August 14, 2023 14:33
@amyeroberts
Copy link
Contributor Author

cc @rwightman Managed to track down the issue with the efficient net predictions on the hub

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Aug 14, 2023

The documentation is not available anymore as the PR was closed or merged.

Copy link
Collaborator

@sgugger sgugger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch, and necessary breaking change, I agree!

@amyeroberts amyeroberts merged commit c412919 into huggingface:main Aug 14, 2023
@amyeroberts amyeroberts deleted the fix-efficientnet-softmax branch August 14, 2023 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants