mmcv
mmcv copied to clipboard
[Fix] _init_dist_slurm can fail if scontrol gives a warning
Thanks for your contribution and we appreciate it a lot. The following instructions would make your pull request more healthy and more easily get feedback. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers.
Motivation
subprocess.getoutput also returns stderr. If scontrol issues a warning, the variable addr will include this warning. Using subprocess.check_output fixes this. Reference: [1]:https://docs.python.org/2/library/subprocess.html#subprocess.check_output
Modification
Use subprocess.check_output instead of subprocess.getoutput in mmcv.runner._init_dist_slurm
Checklist
Before PR:
- [x] I have read and followed the workflow indicated in the CONTRIBUTING.md to create this PR.
- [x] Pre-commit or linting tools indicated in CONTRIBUTING.md are used to fix the potential lint issues.
- [ ] Bug fixes are covered by unit tests, the case that causes the bug should be added in the unit tests.
- [ ] New functionalities are covered by complete unit tests. If not, please add more unit test to ensure the correctness.
- [ ] The documentation has been modified accordingly, including docstring or example tutorials.
After PR:
- [ ] If the modification has potential influence on downstream or other related projects, this PR should be tested with some of those projects, like MMDet or MMCls.
- [ ] CLA has been signed and all committers have signed the CLA in this PR.
Thanks for your contribution.I add a ref link,which explain subprocess.check_output
.
maybe need to fix some lint @TimDarcet
maybe need to fix some lint @TimDarcet
I change it anyway.
unit tests failed
Hi @TimDarcet !We are grateful for your efforts in helping improve mmcv open-source project during your personal time. Welcome to join OpenMMLab Special Interest Group (SIG) private channel on Discord, where you can share your experiences, ideas, and build connections with like-minded peers. To join the SIG channel, simply message moderator— OpenMMLab on Discord or briefly share your open-source contributions in the #introductions channel and we will assist you. Look forward to seeing you there! Join us :https://discord.gg/UjgXkPWNqA If you have a WeChat account,welcome to join our community on WeChat. You can add our assistant :openmmlabwx. Please add "mmsig + Github ID" as a remark when adding friends:) Thank you again for your contribution❤