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

[Enhance] New-style CPU training and inference. #1251

Merged
merged 16 commits into from
Jan 28, 2022

Conversation

MengzhangLI
Copy link
Contributor

@MengzhangLI MengzhangLI commented Jan 27, 2022

Motivation

Refers to open-mmlab/mmdetection#7016, and it's based on open-mmlab/mmcv#1621

Also solute to open-mmlab/mmocr#752.

Note: Due to modification of mmcv/parallel/_functions.py, see pr here.

else:
    # unsqueeze the first dimension thus the tensor's shape is the
    # same as those scattered with GPU.
    output = output.unsqueeze(0)

Due to deletion of above lines, so if use CPU function in this pr but mmcv is not the latest version, the error would be raised:

RuntimeError: Expected 4-dimensional input for 4-dimensional weight [64, 3, 3, 3], but got 5-dimensional input of size [1, 4, 3, 128, 128] instead

@MengzhangLI MengzhangLI self-assigned this Jan 27, 2022
@codecov
Copy link

codecov bot commented Jan 27, 2022

Codecov Report

Merging #1251 (22a880e) into master (02d2790) will decrease coverage by 0.02%.
The diff coverage is 40.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1251      +/-   ##
==========================================
- Coverage   90.29%   90.26%   -0.03%     
==========================================
  Files         130      130              
  Lines        7549     7553       +4     
  Branches     1256     1257       +1     
==========================================
+ Hits         6816     6818       +2     
- Misses        526      528       +2     
  Partials      207      207              
Flag Coverage Δ
unittests 90.26% <40.00%> (-0.03%) ⬇️

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

Impacted Files Coverage Δ
mmseg/apis/train.py 21.33% <40.00%> (+1.61%) ⬆️

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 02d2790...22a880e. Read the comment docs.

@MengzhangLI
Copy link
Contributor Author

The file conflict would be raised after #1247 merged.

Wait for resolve...

@MengzhangLI
Copy link
Contributor Author

MengzhangLI commented Jan 28, 2022

Set CUDA_VISIBLE_DEVICES=-1 and it works.

image

image

@MeowZheng MeowZheng merged commit ecda117 into open-mmlab:master Jan 28, 2022
@MengzhangLI MengzhangLI deleted the cpu-train branch February 16, 2022 11:11
bowenroom pushed a commit to bowenroom/mmsegmentation that referenced this pull request Feb 25, 2022
* [Enhance] New-style CPU training and inference.

* assert mmcv version

* SyncBN to BN in training and testing

* SyncBN to BN in training and testing

* upload untracked files to this branch

* delete gpu_ids

* fix bugs

* assert args.gpu_id in train.py

* use cfg.gpu_ids = [args.gpu_id]

* use cfg.gpu_ids = [args.gpu_id]

* fix typo

* fix typo

* fix typos
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.

2 participants