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] Memory leaking in panpotic segmentation evaluation #7538

Merged
merged 7 commits into from
Mar 26, 2022

Conversation

chhluo
Copy link
Collaborator

@chhluo chhluo commented Mar 26, 2022

Related issue cocodataset/panopticapi#27

Motivation

Modification

Add workers.close() and workers.join() after

workers = multiprocessing.Pool(processes=cpu_num)

BC-breaking (Optional)

Use cases (Optional)

Checklist

@codecov
Copy link

codecov bot commented Mar 26, 2022

Codecov Report

Merging #7538 (f55888e) into dev (1a9087b) will increase coverage by 0.47%.
The diff coverage is 83.46%.

@@            Coverage Diff             @@
##              dev    #7538      +/-   ##
==========================================
+ Coverage   63.62%   64.10%   +0.47%     
==========================================
  Files         341      346       +5     
  Lines       27585    28117     +532     
  Branches     4660     4744      +84     
==========================================
+ Hits        17552    18024     +472     
- Misses       9109     9150      +41     
- Partials      924      943      +19     
Flag Coverage Δ
unittests 64.07% <83.46%> (+0.47%) ⬆️

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

Impacted Files Coverage Δ
mmdet/datasets/coco.py 58.22% <ø> (ø)
...mdet/models/dense_heads/free_anchor_retina_head.py 16.00% <0.00%> (ø)
mmdet/utils/misc.py 64.10% <22.22%> (-35.90%) ⬇️
mmdet/models/backbones/efficientnet.py 62.58% <62.58%> (ø)
...ds/panoptic_fusion_heads/maskformer_fusion_head.py 75.82% <75.82%> (ø)
mmdet/models/losses/cross_entropy_loss.py 97.50% <88.88%> (-2.50%) ⬇️
mmdet/core/bbox/match_costs/match_cost.py 96.00% <90.47%> (-1.47%) ⬇️
mmdet/models/detectors/maskformer.py 68.57% <95.83%> (+5.41%) ⬆️
mmdet/models/dense_heads/mask2former_head.py 96.68% <96.68%> (ø)
mmdet/models/plugins/msdeformattn_pixel_decoder.py 99.00% <99.00%> (ø)
... and 18 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 14f0e95...f55888e. Read the comment docs.

@ZwwWayne ZwwWayne merged commit 664e7be into open-mmlab:dev Mar 26, 2022
@chhluo chhluo deleted the oom_panoptic_eval branch March 28, 2022 12:53
ZwwWayne added a commit that referenced this pull request Mar 30, 2022
* [Fix] Adjust the order of get_classes and FileClient. (#7276)

* delete -sv (#7277)

Co-authored-by: Wenwei Zhang <40779233+ZwwWayne@users.noreply.github.com>

* [Docs] Add Chinese version of finetune (#7178)

* [Fix] Fix wrong img name in onnx2tensorrt.py (#7157)

* [Docs] fix albumentations installed way (#7143)

* Update finetune.md

Translate the finetune.md doc to Chinese

* Update finetune.md

* Update finetune.md

* Update finetune.md

* fix lint

* fx lint

* fix pr

Co-authored-by: Jamie <jamiechoi1995@users.noreply.github.com>
Co-authored-by: BigDong <yudongwang@tju.edu.cn>

* set unmap_results=True in ssd_head (#7328)

* Update YOLOX log for non square input (#7235)

* [Enhance] add cpu_num in cocopanoptic for pq computing (#7315)

* add cpu_num in cocopanoptic for pq computing

* cpu_num -> nproc

* move nproc to evaluate

* [Enhancement] Allow to set channel_order in LoadImageFromFile (#7258)

* allow to set channel_order when loading images

* fix lint

* fix unit test

* fix lint

* [Fix] Force the inputs of `get_bboxes` in yolox_head to float32. (#7324)

* Fix softnms bug

* Add force_fp32 in corner_head and centripetal_head

* [Fix] Fix typo in FPN neck (#7347)

* update readme and pretrained related (#7301)

* [Docs] Add Chinese version of onnx2tensorrt.md (#7219)

* Fix bug of docs

* translate onnx2tensorrt.md

* fix

* fix end-of-file-fixer

* fix some bugs

* 修复链接跳转

* 修复链接跳转

* 修复链接跳转-测试1

* 修复链接跳转-测试2

* 修复链接跳转-测试2

* 修复链接跳转-测试3

* 修复链接跳转-测试5

* Fix

Co-authored-by: jbwang1997 <jbwang1997@gmail.com>

* Update useful_tools.md (#7180)

* [Enhancement]: Update colab tutorials (#7310)

* update colab tutorials

* update

* fix

* fix wrong CUDA explaination

* resolve comments

* resolve comments

* fix typo

Co-authored-by: Cedric Luo <luochunhua1996@outlook.com>
Co-authored-by: tripleMu <92794867+q3394101@users.noreply.github.com>
Co-authored-by: jbwang1997 <jbwang1997@gmail.com>
Co-authored-by: kira <39787375+yangrisheng@users.noreply.github.com>
Co-authored-by: Wenwei Zhang <40779233+ZwwWayne@users.noreply.github.com>

* [Fix] fix misplaced arguments in LoadPanopticAnnotations (#7388)

* [Enhance] Take point sample related functions out of mask_point_head (#7353)

add point sample

replace function in mask_point_head

* [Enhance] Add instance evalutation for coco_panoptic (#7313)

update comments

rename function and replace condition

rename

add message for proposal_fast when instance segmentation evaluation

set cocoGt as arg

update comments

update comments

update docstring and rename

add unit test

update docstring

add assert for instance eval

* [Feature] Add diff seeds to diff ranks. (#7432)

* Enhance the robustness of analyze_logs.py (#7407)

* [Feature] Add multi machine dist_train (#7415)

* [Enchance] Supplementary notes of  sync_random_seed (#7440)

* Supplementary Notes

* update

* update

* update

* Unified name of orig as ori (#7456)

* Remove duplicate link (#7480)

* [Fix] Adding comments for MaxIoUAssigner (#7464)

* Add comments

* update url

* Add description in docstring

* Update sphinx

* update commit

* [Enhance] Update docstring of cross entropy loss (#7472)

* update docstring of ce loss

update docstring

* update docstring

* [Enchance] Added documentation on mmdet using mmcls‘s backbone (#7438)

* add how-to docs

* update

* update index.rst

* update

* update

* Update README.md (#7498)

* fix typos (#7510)

* update-mosaic-to-how-to (#7507)

* [Fix] Fix fpg link (#7478)

* [Doc] Mosaic documentation enhancements (#7470)

* Mosaic documentation enhancements

- Added Mosaic and MultiImageMixDataset must be used together in FAQ document
- Added the demo configuration of Faster R-CNN using Mosaic

* Mosaic doc enhancements

correct some errors as suggested

* Remove unnecessary Settings

a little change

* update some details

* update-mosaic-to-how-to

* Mosaic documentation enhancements

- Added Mosaic and MultiImageMixDataset must be used together in FAQ document
- Added the demo configuration of Faster R-CNN using Mosaic

* Mosaic doc enhancements

correct some errors as suggested

* Remove unnecessary Settings

a little change

* update some details

* rebase dev branch

delete the mosaic in fap.md since it is in how_to.md

* rebase dev

* Mosaic documentation enhancements

- Added Mosaic and MultiImageMixDataset must be used together in FAQ document
- Added the demo configuration of Faster R-CNN using Mosaic

* Mosaic doc enhancements

correct some errors as suggested

* Remove unnecessary Settings

a little change

* update some details

* rebase dev branch

delete the mosaic in fap.md since it is in how_to.md

* Mosaic documentation enhancements

- Added Mosaic and MultiImageMixDataset must be used together in FAQ document
- Added the demo configuration of Faster R-CNN using Mosaic

* Mosaic doc enhancements

correct some errors as suggested

* Remove unnecessary Settings

a little change

* update some details

* rebase dev

* Bug fix: RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cuda:2! (#7521)

修复Free anchor Retinanet网络训练时,可能会遇到计算得到的anchor与pre_bboxes不在同一个cuda device的bug。

* [Feature] Torchvision high-precision ResNet model (#7489)

* Update tnr model

* Update README

* Update README

* Update comments

* Update metafile.yml

* Update model URL

* add msdeformattn pixel decoder (#7466)

fix typo

rm img_metas

rename in pixel_decoder

update comments

rename

fix typo

generae points with MlvlPointGenerator

* [Enhance] MaskFormer refactor (#7471)

* maskformer refactor

update docstring

update docstring

update unit test

update unit test

update unit test

* remove redundant code

* update unit test

* [Feature] Support efficientnet in mmdetection. (#7514)

* Initial implementation

* Add missing import

* Add MemoryEfficientSwishImplementation. Add docstrings

* Add efficientnet2mmdet tool

* Add config folder

* Flake8

* Flake8

* Flake8

* Fix config

* Requested changes

* docformatter

* Update train config from https://github.com/google/automl/blob/master/efficientdet

* Run pre-commit

* Fix schedule

* Set by_epoch=False in scheduler

* Train 80 epochs

* Remove duplicated arg

* Update README.md

* efficient3 efficient0

* efficientNet imports

* efficientNet

* config edit path for eff3 and dropout for eff0

* efficientnet review2

* fix model_converter location and drop path

* fix model converter  and efficientnet import

* register memoryefficietnswish

* eff0, eff3

* fix  flake8 yapf isort

* same padding in tensorflow and edit drop path rate

* fix init of utils

* Align mmdet utils with mmcls

* Align mmdet.models.utils with mmcls

* Use mmcls efficientnet backbone

* Update

* Update

* Update metafile

Co-authored-by: David de la Iglesia Castro <daviddelaiglesiacastro@gmail.com>
Co-authored-by: David de la Iglesia Castro <diglesia@gradiant.org>
Co-authored-by: jiangyitong <jiangyitong1@sensetime.com>
Co-authored-by: jiangyitong <jiangyitong1998@outlook.com>

* [Fix] Fix reduction=mean in CELoss. (#7449)

* [Fix] Fix ignore in CELoss.

* add ut

* fix and add comments

* add avg_non_ignore option

* bce avg

* fix lint

* [Enhance] update pascal voc result (#7503)

* [Enhance] update pascal voc result

* minor fix

* [Feature] Support to set data root through commands (#7386)

* Fix #6915: Support to set data root through commands

* Support #6915: seperate function in tools/utils.py, support test.py and browse_dataset.py

* update #6915: refactor the code ref @hhaAndroid advice

* support #6915: fix format problem

* supoort corresponding scripts and update doc @hhaAndroid

* updata misc.py as @ZwwWayne and @hhaAndroid

* Update mmdet/utils/misc.py

Co-authored-by: Haian Huang(深度眸) <1286304229@qq.com>

* fix mmdet/utils/misc.py format problem

Co-authored-by: Haian Huang(深度眸) <1286304229@qq.com>

* [Feature] Add Mask2Former to mmdet (#6938)

update doc

update doc format

deepcopy pixel_decoder cfg

move mask_pseudo_sampler cfg to config file

move part of postprocess from head to detector

fix bug in postprocessing

move class setting from head to config file

remove if else

move mask2bbox to mask/util

update docstring

update docstring in result2json

fix bug

update class_weight

add maskformer_fusion_head

add maskformer fusion head

update

add cfg for filter_low_score

update maskformer

update class_weight

update config

update unit test

rename param

update comments in config

rename variable, rm arg, update unit tests

update mask2bbox

add unit test for mask2bbox

replace unsqueeze(1) and squeeze(1)

add unit test for maskformer_fusion_head

update docstrings

update docstring

delete \

remove modification to ce loss

update docstring

update docstring

update docstring of ce loss

update unit test

update docstring

update docstring

update docstring

rename

rename

add msdeformattn pixel decoder

maskformer refactor

add strides in config

remove redundant code

remove redundant code

update unit test

update config

update

* [Fix] Update unit test of CrossEntropyCost (#7537)

* [Fix] Memory leaking in panpotic segmentation evaluation (#7538)

* fix broadcast shape bug in yolov3 (#7551)

* Fix `pointrend` missing `get_uncertainty` function bug (#7550)

* [Fix] Adjust the order of get_classes and FileClient. (#7276)

* delete -sv (#7277)

Co-authored-by: Wenwei Zhang <40779233+ZwwWayne@users.noreply.github.com>

* [Docs] Add Chinese version of finetune (#7178)

* [Fix] Fix wrong img name in onnx2tensorrt.py (#7157)

* [Docs] fix albumentations installed way (#7143)

* Update finetune.md

Translate the finetune.md doc to Chinese

* Update finetune.md

* Update finetune.md

* Update finetune.md

* fix lint

* fx lint

* fix pr

Co-authored-by: Jamie <jamiechoi1995@users.noreply.github.com>
Co-authored-by: BigDong <yudongwang@tju.edu.cn>

* set unmap_results=True in ssd_head (#7328)

* Update YOLOX log for non square input (#7235)

* [Enhance] add cpu_num in cocopanoptic for pq computing (#7315)

* add cpu_num in cocopanoptic for pq computing

* cpu_num -> nproc

* move nproc to evaluate

* [Enhancement] Allow to set channel_order in LoadImageFromFile (#7258)

* allow to set channel_order when loading images

* fix lint

* fix unit test

* fix lint

* [Fix] Force the inputs of `get_bboxes` in yolox_head to float32. (#7324)

* Fix softnms bug

* Add force_fp32 in corner_head and centripetal_head

* [Fix] Fix typo in FPN neck (#7347)

* update readme and pretrained related (#7301)

* [Docs] Add Chinese version of onnx2tensorrt.md (#7219)

* Fix bug of docs

* translate onnx2tensorrt.md

* fix

* fix end-of-file-fixer

* fix some bugs

* 修复链接跳转

* 修复链接跳转

* 修复链接跳转-测试1

* 修复链接跳转-测试2

* 修复链接跳转-测试2

* 修复链接跳转-测试3

* 修复链接跳转-测试5

* Fix

Co-authored-by: jbwang1997 <jbwang1997@gmail.com>

* Update useful_tools.md (#7180)

* [Enhancement]: Update colab tutorials (#7310)

* update colab tutorials

* update

* fix

* fix wrong CUDA explaination

* resolve comments

* resolve comments

* fix typo

Co-authored-by: Cedric Luo <luochunhua1996@outlook.com>
Co-authored-by: tripleMu <92794867+q3394101@users.noreply.github.com>
Co-authored-by: jbwang1997 <jbwang1997@gmail.com>
Co-authored-by: kira <39787375+yangrisheng@users.noreply.github.com>
Co-authored-by: Wenwei Zhang <40779233+ZwwWayne@users.noreply.github.com>

* Fix pointrend missing get_uncertainty function bug

Co-authored-by: Wencheng Wu <41542251+274869388@users.noreply.github.com>
Co-authored-by: Yue Zhou <592267829@qq.com>
Co-authored-by: Wenwei Zhang <40779233+ZwwWayne@users.noreply.github.com>
Co-authored-by: MingJian.L <45811724+matrixgame2018@users.noreply.github.com>
Co-authored-by: Jamie <jamiechoi1995@users.noreply.github.com>
Co-authored-by: BigDong <yudongwang@tju.edu.cn>
Co-authored-by: Cedric Luo <26483343+chhluo@users.noreply.github.com>
Co-authored-by: Yosuke Shinya <42844407+shinya7y@users.noreply.github.com>
Co-authored-by: Cedric Luo <luochunhua1996@outlook.com>
Co-authored-by: Jingwei Zhang <zjw18@mails.tsinghua.edu.cn>
Co-authored-by: jbwang1997 <jbwang1997@gmail.com>
Co-authored-by: Xiangxu-0103 <xuxiang0103@gmail.com>
Co-authored-by: tripleMu <92794867+q3394101@users.noreply.github.com>
Co-authored-by: kira <39787375+yangrisheng@users.noreply.github.com>

* fix docstring in bbox_nms.py (#7547)

* Create init_cfg.md

* Update docs/zh_cn/tutorials/init_cfg.md

Co-authored-by: Haian Huang(深度眸) <1286304229@qq.com>

* update init_cfg.md

* update init_cfg.md

* update init_cfg.md

* update init_cfg.md

* fix docstring

* fix docstring

Co-authored-by: Haian Huang(深度眸) <1286304229@qq.com>

* [Doc] Add doc for COCO panoptic segmentation test results submission  (#7430)

* [Doc] Add doc for coco panoptic segmentation test results submission

* add example

* add script

* update comments

* update

* update

* update

* update

* update

* Bump versions to v2.23.0 (#7555)

* Bump versions to v2.23.0

* update log

* replace two Efficientnet

* update mask2former log

* add maskformer and mask2former in README_zh-CN.md

* add efficientnet in README.md and  README_zh-CN.md

* update changelog

* simplify highlights

* update changelog.

* update changelog again

* add some highlights

Co-authored-by: Wencheng Wu <41542251+274869388@users.noreply.github.com>
Co-authored-by: Yue Zhou <592267829@qq.com>
Co-authored-by: MingJian.L <45811724+matrixgame2018@users.noreply.github.com>
Co-authored-by: Jamie <jamiechoi1995@users.noreply.github.com>
Co-authored-by: BigDong <yudongwang@tju.edu.cn>
Co-authored-by: Cedric Luo <26483343+chhluo@users.noreply.github.com>
Co-authored-by: Yosuke Shinya <42844407+shinya7y@users.noreply.github.com>
Co-authored-by: Cedric Luo <luochunhua1996@outlook.com>
Co-authored-by: Jingwei Zhang <zjw18@mails.tsinghua.edu.cn>
Co-authored-by: jbwang1997 <jbwang1997@gmail.com>
Co-authored-by: Xiangxu-0103 <xuxiang0103@gmail.com>
Co-authored-by: tripleMu <92794867+q3394101@users.noreply.github.com>
Co-authored-by: kira <39787375+yangrisheng@users.noreply.github.com>
Co-authored-by: Haian Huang(深度眸) <1286304229@qq.com>
Co-authored-by: Shilong Zhang <61961338+jshilong@users.noreply.github.com>
Co-authored-by: Osman F Bayram <74963545+osbm@users.noreply.github.com>
Co-authored-by: Diego <ceroytres@users.noreply.github.com>
Co-authored-by: Noah <37148740+bunge-bedstraw-herb@users.noreply.github.com>
Co-authored-by: Youth-Got <53550307+Youth-Got@users.noreply.github.com>
Co-authored-by: David de la Iglesia Castro <daviddelaiglesiacastro@gmail.com>
Co-authored-by: David de la Iglesia Castro <diglesia@gradiant.org>
Co-authored-by: jiangyitong <jiangyitong1@sensetime.com>
Co-authored-by: jiangyitong <jiangyitong1998@outlook.com>
Co-authored-by: RangiLyu <lyuchqi@gmail.com>
Co-authored-by: CCODING <ccoding04@gmail.com>
Co-authored-by: Kevin Ye <1752391457@qq.com>
Co-authored-by: Czm369 <40661020+Czm369@users.noreply.github.com>
ZwwWayne pushed a commit to ZwwWayne/mmdetection that referenced this pull request Jul 19, 2022
SakiRinn pushed a commit to SakiRinn/mmdetection-locount that referenced this pull request Mar 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants