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] rotation classifier input move to model device #1039

Merged

Conversation

felixdittrich92
Copy link
Contributor

This PR:

  • fix moving rotation classifier input to cuda device if given

Closes:
#1020

@felixdittrich92 felixdittrich92 self-assigned this Sep 1, 2022
@felixdittrich92 felixdittrich92 added this to the 0.6.0 milestone Sep 1, 2022
@felixdittrich92 felixdittrich92 added type: bug Something isn't working module: models Related to doctr.models framework: pytorch Related to PyTorch backend labels Sep 1, 2022
@felixdittrich92 felixdittrich92 linked an issue Sep 1, 2022 that may be closed by this pull request
@felixdittrich92 felixdittrich92 modified the milestones: 0.6.0, 0.5.2 Sep 1, 2022
@codecov
Copy link

codecov bot commented Sep 1, 2022

Codecov Report

Merging #1039 (29f67df) into main (75aa42a) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1039      +/-   ##
==========================================
- Coverage   94.93%   94.91%   -0.02%     
==========================================
  Files         135      135              
  Lines        5625     5626       +1     
==========================================
  Hits         5340     5340              
- 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.

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.

thanks!

@felixdittrich92 felixdittrich92 merged commit 73d5242 into mindee:main Sep 2, 2022
@felixdittrich92 felixdittrich92 deleted the fix-classification-cuda branch September 2, 2022 15:40
@felixdittrich92 felixdittrich92 modified the milestones: 0.5.2, 0.6.0 Sep 26, 2022
@felixdittrich92 felixdittrich92 mentioned this pull request Sep 26, 2022
85 tasks
@minouei-kl
Copy link

minouei-kl commented Jan 4, 2023

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
Copy link
Collaborator

@minouei-kl thanks! @felixdittrich92 saw this problem in #1020 but batch has not been moved to the good device. I'll fix that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
framework: pytorch Related to PyTorch backend module: models Related to doctr.models type: bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GPU inference error using db_resne50_rotation
4 participants