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 bug when RepPoints run in a specific gpu instead of cuda:0 #3836

Merged
merged 1 commit into from
Sep 26, 2020
Merged

fix bug when RepPoints run in a specific gpu instead of cuda:0 #3836

merged 1 commit into from
Sep 26, 2020

Conversation

yuzhj
Copy link
Contributor

@yuzhj yuzhj commented Sep 25, 2020

fix #3828

@codecov
Copy link

codecov bot commented Sep 25, 2020

Codecov Report

Merging #3836 into master will increase coverage by 0.61%.
The diff coverage is 75.43%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3836      +/-   ##
==========================================
+ Coverage   60.93%   61.55%   +0.61%     
==========================================
  Files         217      216       -1     
  Lines       15374    15517     +143     
  Branches     2628     2634       +6     
==========================================
+ Hits         9368     9551     +183     
+ Misses       5537     5489      -48     
- Partials      469      477       +8     
Flag Coverage Δ
#unittests 61.55% <75.43%> (+0.61%) ⬆️

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

Impacted Files Coverage Δ
mmdet/models/dense_heads/rpn_test_mixin.py 83.87% <0.00%> (ø)
mmdet/models/detectors/reppoints_detector.py 100.00% <ø> (+75.00%) ⬆️
mmdet/models/detectors/single_stage.py 84.61% <0.00%> (-3.39%) ⬇️
mmdet/models/dense_heads/dense_test_mixins.py 15.00% <15.00%> (ø)
mmdet/models/dense_heads/gfl_head.py 27.39% <20.00%> (+0.08%) ⬆️
mmdet/models/dense_heads/reppoints_head.py 22.16% <20.00%> (-0.19%) ⬇️
mmdet/models/dense_heads/atss_head.py 28.44% <40.00%> (+0.37%) ⬆️
mmdet/core/fp16/deprecated_fp16_utils.py 46.66% <46.66%> (ø)
mmdet/models/dense_heads/anchor_head.py 85.04% <58.33%> (-1.85%) ⬇️
mmdet/utils/collect_env.py 40.00% <66.66%> (+17.08%) ⬆️
... and 33 more

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 11b1ef8...9fe6141. Read the comment docs.

@@ -534,6 +534,7 @@ def loss_single(self, cls_score, pts_pred_init, pts_pred_refine, labels,
label_weights = label_weights.reshape(-1)
cls_score = cls_score.permute(0, 2, 3,
1).reshape(-1, self.cls_out_channels)
cls_score = cls_score.contiguous()
Copy link
Collaborator

Choose a reason for hiding this comment

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

reshape should have done contiguous() implicitly.
Will there be bugs if this line is removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

reshape should have done contiguous() implicitly.
Will there be bugs if this line is removed?

yes , focal_loss will throw RuntimeError

mmcv/ops/focal_loss.py", line 55, in forward
    input, target, weight, output, gamma=ctx.gamma, alpha=ctx.alpha)
RuntimeError: input must be contiguous

@yuzhj yuzhj requested a review from xvjiarui September 25, 2020 14:53
@hellock hellock merged commit cda75f9 into open-mmlab:master Sep 26, 2020
@yuzhj yuzhj deleted the reppoints_specific_gpu branch September 27, 2020 01:57
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.

RuntimeError: expected device cuda:1 but got device cuda:0
3 participants