[Fix] rotation classifier input move to model device by felixdittrich92 · Pull Request #1039 · mindee/doctr (original) (raw)

@felixdittrich92

@felixdittrich92 felixdittrich92 commented

Sep 1, 2022

Copy link Copy Markdown

Collaborator

This PR:

Closes:
#1020

@felixdittrich92

[fix classification model cuda move](/mindee/doctr/pull/1039/commits/29f67df2fe5236fb7522c50d293bbe7771fde116 "fix classification model cuda move")

[29f67df](/mindee/doctr/pull/1039/commits/29f67df2fe5236fb7522c50d293bbe7771fde116)

@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 requested review fromaminemindee, charlesmindee, frgfm and odulcy-mindee

September 1, 2022 19:15

@felixdittrich92 felixdittrich92 linked an issue

Sep 1, 2022

that may beclosed by this pull request

GPU inference error using db_resne50_rotation#1020

Closed

@felixdittrich92 felixdittrich92 modified the milestones:0.6.0, 0.5.2

Sep 1, 2022

@codecov

codecov Bot commented

Sep 1, 2022

Copy link Copy Markdown

Codecov Report

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

@@ Coverage Diff @@ ## main #1039 +/- ##

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

charlesmindee approved these changes Sep 2, 2022

View reviewed changes

@charlesmindee 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 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

Release tracker - v0.6.0#791

Closed

85 tasks

@minouei-kl

minouei-kl commented

Jan 4, 2023

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

odulcy-mindee commented

Jan 9, 2023

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 odulcy-mindee mentioned this pull request

Jan 9, 2023

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 }})