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] Fix bbox clamp in pt1.10 #7074

Merged
merged 1 commit into from
Jan 26, 2022
Merged

Conversation

RangiLyu
Copy link
Member

Motivation

FCOS and AutoAssign cannot run with PyTorch 1.10.
Error message:

RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.FloatTensor [2, 4, 20, 20]], which is output 0 of ReluBackward0, is at version 1; expected version 0 instead.

After using with torch.autograd.set_detect_anomaly(True): to debug and find out that it was caused by the ReLU in bbox branch.

Modification

Replace F.relu(bbox_pred) with bbox_pred.clamp(min=0)

@RangiLyu RangiLyu added the bug Something isn't working label Jan 25, 2022
@codecov
Copy link

codecov bot commented Jan 25, 2022

Codecov Report

Merging #7074 (9ae7878) into dev (4b87ddc) will decrease coverage by 0.00%.
The diff coverage is 50.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev    #7074      +/-   ##
==========================================
- Coverage   62.39%   62.38%   -0.01%     
==========================================
  Files         329      329              
  Lines       26176    26175       -1     
  Branches     4432     4432              
==========================================
- Hits        16332    16330       -2     
- Misses       8974     8975       +1     
  Partials      870      870              
Flag Coverage Δ
unittests 62.36% <50.00%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
mmdet/models/dense_heads/fcos_head.py 76.12% <0.00%> (-0.16%) ⬇️
mmdet/models/dense_heads/autoassign_head.py 94.02% <100.00%> (ø)
mmdet/core/bbox/samplers/random_sampler.py 75.00% <0.00%> (-5.56%) ⬇️
mmdet/apis/train.py 15.66% <0.00%> (ø)
mmdet/core/bbox/samplers/sampling_result.py 74.60% <0.00%> (+1.58%) ⬆️

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 4b87ddc...9ae7878. Read the comment docs.

@RangiLyu RangiLyu added WIP Working in progress bug Something isn't working and removed bug Something isn't working WIP Working in progress labels Jan 26, 2022
@ZwwWayne ZwwWayne merged commit 25a95d2 into open-mmlab:dev Jan 26, 2022
@ZwwWayne
Copy link
Collaborator

Several things to be done after merging this PR:

  1. Should add comments above the line of code to indicate the reason for the change.
  2. CI of PyTorch 1.10.

@ZwwWayne ZwwWayne mentioned this pull request Jan 27, 2022
chhluo pushed a commit to chhluo/mmdetection that referenced this pull request Feb 21, 2022
ZwwWayne pushed a commit that referenced this pull request Jul 18, 2022
ZwwWayne pushed a commit to ZwwWayne/mmdetection that referenced this pull request Jul 19, 2022
@RangiLyu RangiLyu deleted the fix_pt1.10 branch December 17, 2022 03:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants