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
ConvNeXt classifier_activation=softmax
returns linear layer
#319
Comments
FYI, all models are moving to keras-cv. keras-team/keras-cv#678 |
I see, in keras-cv the implementation is correct. Shall I close this issue? |
Yes, you may. All the models from application will be moved to kcv completely soon. |
@Frightera please re-open this ticket.
I was wrong. This should be discussed and fixed right away. |
@innat Sure, re-opened it. Should be a small and easy fix. I think I can create a PR for that now. |
Imported from GitHub PR #17544 Fixes the issue #17386. Please find the bug, fix, and test [gist here](https://colab.research.google.com/gist/Frightera/93a784fc0e03a19f5804e7e14bfbecba/-17386.ipynb). Copybara import of the project: -- eedabb6 by Kaan <46622558+Frightera@users.noreply.github.com>: Pass classifier_activation arg to "Head" -- e226091 by Kaan <46622558+Frightera@users.noreply.github.com>: Add classifier_activation to the docstring -- 3856fed by Kaan <46622558+Frightera@users.noreply.github.com>: Add classifier_activation unit test -- c3dfc34 by Kaan <46622558+Frightera@users.noreply.github.com>: Move classifier_activation validation before head creation -- 71eaa69 by Kaan <46622558+Frightera@users.noreply.github.com>: Update test_application_classifier_activation -- ebd6940 by Kaan Bıçakcı <kaan.dvlpr@gmail.com>: Reformatting using format.sh -- bce4ac9 by Kaan Bıçakcı <kaan.dvlpr@gmail.com>: Fix test_application_classifier_activation test -- 00d4889 by Kaan Bıçakcı <kaan.dvlpr@gmail.com>: Fix Head params to accept classifier_activation -- 2c22d37 by Kaan Bıçakcı <kaan.dvlpr@gmail.com>: Revert "Fix Head params to accept classifier_activation" This reverts commit 00d4889. -- 3abd441 by Kaan Bıçakcı <kaan.dvlpr@gmail.com>: Exclude RegNet in test_application_classifier_activation Merging this change closes #17544 FUTURE_COPYBARA_INTEGRATE_REVIEW=#17544 from Frightera:frightera_fix_17386 3abd441 PiperOrigin-RevId: 509550999
Closing as PR was merged. |
Describe the problem.
Specifying
classifier_activation=softmax
in ConvNeXt models does not work, instead it returns the model with a linear classifier layer.Inspecting source code:
https://github.com/keras-team/keras/blob/e6784e4302c7b8cd116b74a784f4b78d60e83c26/keras/applications/convnext.py#L524-L526
Definition of
Head
function:https://github.com/keras-team/keras/blob/e6784e4302c7b8cd116b74a784f4b78d60e83c26/keras/applications/convnext.py#L327-L348
Find the Colab gist here.
If OK I can open a PR and fix it.
The text was updated successfully, but these errors were encountered: