[Fix] rotation classifier input move to model device by felixdittrich92 · Pull Request #1039 · mindee/doctr (original) (raw)
felixdittrich92 commented
Copy link Copy Markdown
Collaborator
This PR:
- fix moving rotation classifier input to cuda device if given
Closes:
#1020
[fix classification model cuda move](/mindee/doctr/pull/1039/commits/29f67df2fe5236fb7522c50d293bbe7771fde116 "fix classification model cuda move")
[29f67df](/mindee/doctr/pull/1039/commits/29f67df2fe5236fb7522c50d293bbe7771fde116)
felixdittrich92 self-assigned this
felixdittrich92 added this to the 0.6.0 milestone
felixdittrich92 added type: bug
Something isn't working
Related to doctr.models
Related to PyTorch backend
labels
felixdittrich92 requested review fromaminemindee, charlesmindee, frgfm and odulcy-mindee
felixdittrich92 linked an issue
that may beclosed by this pull request
GPU inference error using db_resne50_rotation#1020
Closed
felixdittrich92 modified the milestones:0.6.0, 0.5.2
codecov Bot commented
Copy link Copy Markdown
Codecov Report
Merging #1039 (29f67df) into main (75aa42a) will decrease coverage by
0.01%.
The diff coverage is100.00%.
@@ Coverage Diff @@ ## main #1039 +/- ##
Coverage 94.93% 94.91% -0.02%
Files 135 135
Hits 5340 5340
Lines 5625 5626 +1- Misses 285 286 +1
| Flag | Coverage Δ | |
|---|---|---|
| unittests | 94.91% <100.00%> (-0.02%) | ⬇️ |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Impacted Files | Coverage Δ | |
|---|---|---|
| doctr/models/classification/predictor/pytorch.py | 95.00% <100.00%> (+0.26%) | ⬆️ |
| doctr/transforms/functional/base.py | 95.65% <0.00%> (-1.45%) | ⬇️ |
| doctr/transforms/modules/base.py | 94.59% <0.00%> (ø) |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
charlesmindee approved these changes Sep 2, 2022
charlesmindee left a comment
Copy link Copy Markdown
Collaborator
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
felixdittrich92 merged commit 73d5242 into mindee:main
felixdittrich92 deleted the fix-classification-cuda branch
felixdittrich92 modified the milestones:0.5.2, 0.6.0
felixdittrich92 mentioned this pull request
Closed
85 tasks
minouei-kl commented
•
edited
Loading
Copy link Copy Markdown
for me this fix didn't worked I had to change it like this:
_device = next(self.model.parameters()).device
predicted_batches = [self.model(batch.to(device=_device)).to(device=_device) for batch in processed_batches]
odulcy-mindee commented
Copy link Copy Markdown
Contributor
@minouei-kl thanks! @felixdittrich92 saw this problem in #1020 but batch has not been moved to the good device. I'll fix that.
odulcy-mindee mentioned this pull request
fix classification model cuda move#1125
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})