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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PyTorch][references] fix pretrained with different vocabs #874

Merged
merged 27 commits into from
Apr 5, 2022

Conversation

felixdittrich92
Copy link
Contributor

@felixdittrich92 felixdittrich92 commented Mar 29, 2022

This PR fixes the mismatching linear layers at each model if we pass a different vocab as french and the pretrained flag to the training scripts

  • recognition: only crnn because sar and master broken and have currently no pretrained version
  • classification: all

Any feedback is welcome 馃

@codecov
Copy link

codecov bot commented Mar 29, 2022

Codecov Report

Merging #874 (0bbbb94) into main (509fce8) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #874      +/-   ##
==========================================
- Coverage   94.84%   94.84%   -0.01%     
==========================================
  Files         133      133              
  Lines        5200     5215      +15     
==========================================
+ Hits         4932     4946      +14     
- Misses        268      269       +1     
Flag Coverage 螖
unittests 94.84% <100.00%> (-0.01%) 猬囷笍

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

Impacted Files Coverage 螖
doctr/models/classification/magc_resnet/pytorch.py 100.00% <100.00%> (酶)
doctr/models/classification/mobilenet/pytorch.py 100.00% <100.00%> (酶)
doctr/models/classification/resnet/pytorch.py 100.00% <100.00%> (酶)
doctr/models/classification/vgg/pytorch.py 100.00% <100.00%> (酶)
doctr/models/recognition/crnn/pytorch.py 94.38% <100.00%> (+0.12%) 猬嗭笍
doctr/models/utils/pytorch.py 100.00% <100.00%> (酶)
doctr/transforms/functional/base.py 95.65% <0.00%> (-1.45%) 猬囷笍
doctr/transforms/modules/base.py 94.59% <0.00%> (酶)

Continue to review full report at Codecov.

Legend - Click here to learn more
螖 = absolute <relative> (impact), 酶 = not affected, ? = missing data
Powered by Codecov. Last update 509fce8...0bbbb94. Read the comment docs.

@felixdittrich92 felixdittrich92 changed the title [WIP][PyTorch][references] fix pretrained with different vocabs [PyTorch][references] fix pretrained with different vocabs Mar 30, 2022
@felixdittrich92 felixdittrich92 marked this pull request as ready for review March 30, 2022 10:01
Copy link
Collaborator

@charlesmindee charlesmindee left a comment

Choose a reason for hiding this comment

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

Thank you for the fix!

@felixdittrich92
Copy link
Contributor Author

@charlesmindee TF needs the same but will do in another PR :) i think in TF its enough to modify the checkpoint loading

@charlesmindee charlesmindee merged commit 6e806ca into mindee:main Apr 5, 2022
@felixdittrich92 felixdittrich92 deleted the fix-pretrained branch April 5, 2022 14:19
felixdittrich92 added a commit to felixdittrich92/doctr that referenced this pull request Apr 5, 2022
* backup

* fix-first

* update

* flake

* update

* revert ugly new head idea

* add reco test
felixdittrich92 added a commit to felixdittrich92/doctr that referenced this pull request Apr 7, 2022
* backup

* fix-first

* update

* flake

* update

* revert ugly new head idea

* add reco test
@frgfm frgfm added type: bug Something isn't working module: models Related to doctr.models topic: text recognition Related to the task of text recognition topic: character classification Related to the task of character classification labels May 2, 2022
@felixdittrich92 felixdittrich92 added this to the 0.6.0 milestone Jun 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: models Related to doctr.models topic: character classification Related to the task of character classification topic: text recognition Related to the task of text recognition type: bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants