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

[Fix]: Fix optimizer 'ValueError' when using PReLU activation. #2444

Merged
merged 3 commits into from
Dec 6, 2022

Conversation

KeiChiTse
Copy link
Contributor

Motivation

When using parameterized activation like PReLU in FFN, current way of initializing activation functions will cause a 'ValueError' in optimizer.
i.e. ValueError: some parameters appear in more than one parameter group

Modification

Call 'build_activation_layer' function repeatedly instead of using 'self.activate' multiple times.

@CLAassistant
Copy link

CLAassistant commented Nov 22, 2022

CLA assistant check
All committers have signed the CLA.

@zhouzaida
Copy link
Collaborator

CLA assistant check Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.You have signed the CLA already but the status is still pending? Let us recheck it.

Hi, thanks for your contribution. Please sign the CLA before we merge this PR.

@KeiChiTse
Copy link
Contributor Author

CLA assistant check Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.You have signed the CLA already but the status is still pending? Let us recheck it.

Hi, thanks for your contribution. Please sign the CLA before we merge this PR.

Hi! I've signed the CLA license already!

@zhouzaida
Copy link
Collaborator

Hi, the lint failed and you can merge the upstream 2.x to fix the error.

@KeiChiTse
Copy link
Contributor Author

Hi, the lint failed and you can merge the upstream 2.x to fix the error.

图片
Hi! I wonder how can I fix this mypy hook error?

@zhouzaida
Copy link
Collaborator

Hi, you can use the following commands to fix the mypy error.

git remote add open-mmlab [email protected]:open-mmlab/mmcv.git
git pull open-mmlab 2.x

@zhouzaida zhouzaida merged commit 6e81830 into open-mmlab:2.x Dec 6, 2022
tyomj pushed a commit to tyomj/mmcv that referenced this pull request May 8, 2023
…lab#2444)

* fix optimizer ValueError when using PReLU activation.

* fix lint error
Copy link

codecov bot commented Dec 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 66.59%. Comparing base (ac47088) to head (5be3818).
Report is 55 commits behind head on 2.x.

Additional details and impacted files
@@            Coverage Diff             @@
##              2.x    #2444      +/-   ##
==========================================
- Coverage   66.60%   66.59%   -0.01%     
==========================================
  Files         120      120              
  Lines        7801     7799       -2     
  Branches     1067     1067              
==========================================
- Hits         5196     5194       -2     
  Misses       2438     2438              
  Partials      167      167              
Flag Coverage Δ
unittests 66.59% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

4 participants