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

[bug] error when using python tools/train.py to train ReDet in MMRotate. #638

Closed
zytx121 opened this issue Oct 24, 2022 · 4 comments · Fixed by #695
Closed

[bug] error when using python tools/train.py to train ReDet in MMRotate. #638

zytx121 opened this issue Oct 24, 2022 · 4 comments · Fixed by #695
Assignees

Comments

@zytx121
Copy link

zytx121 commented Oct 24, 2022

when the self.distributed equals to False, revert_sync_batchnorm function cannot work normally.

model = revert_sync_batchnorm(model)

We argue this is caused by ReDet replacing torch.nn with e2cnn.nn.

https://github.com/open-mmlab/mmrotate/blob/dev-1.x/mmrotate/models/backbones/re_resnet.py

@zytx121 zytx121 changed the title [bug] something wrong when using python tools/train.py to train ReDet in MMRotate. [bug] error when using python tools/train.py to train ReDet in MMRotate. Oct 24, 2022
@HAOCHENYE
Copy link
Collaborator

Can you provide a more detailed description of the error? Does revert_sync_batchnorm raise an error or not convert the SyncBN to BN?

@zytx121
Copy link
Author

zytx121 commented Oct 31, 2022

1667186839276

Yes, revert_sync_batchnorm raises an error when converting the SyncBN to BN. However, there is no SyncBatchNorm module in e2cnn. The error occurs by the add_module function. In e2cnn, R2Conv is the smallest unit, which cannot be split. When we try to recreate R2Conv by add_module, this line raise an error. It looks like R2Conv don't support being created by his child modules.

Maybe, we need to allow the user to close revert_sync_batchnorm in the runner.

@HAOCHENYE
Copy link
Collaborator

HAOCHENYE commented Oct 31, 2022

It makes sense to me. Will it be more proper to fallback not revert SyncBN if revert_sync_batchnorm failed?

@zytx121
Copy link
Author

zytx121 commented Nov 7, 2022

It makes sense to me. Will it be more proper to fallback not revert SyncBN if revert_sync_batchnorm failed?

That sounds like a nice idea.

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 a pull request may close this issue.

2 participants