Commit Graph

137 Commits (83d9a9c89b5467a00c4976fd60a75d0b9412110a)

Author SHA1 Message Date
Jerry Jiarui XU 83d9a9c89b
[Feature] Add diagonal flip (#515) 2020-08-22 14:29:27 +08:00
Kevin 95a9728c42
Support pickle.loads (#499) (#500) 2020-08-21 13:06:00 +08:00
Cao Yuhang 7b18b97791
fix saconv (#489)
* fix saconv

* add parrots condition

* add unittest

* fix torch version
2020-08-16 01:45:01 +08:00
Wang Xinjiang eacaf475f7
fix some pavi logger hooks (#481)
* fix some pavi logger hooks

* fix unittest

* fix small bugs

* small change

* fix unittest

* Add EpochBasedRunner conditions

* Add session text

* fix small bug

* fetch runner mode from log buffer

* Add max_iter to pavi session text

* change yaml.dump to yamp.dump(yaml.load(mmcv.dump))

* Directly use by_epoch

* fix unittest

* add comments

* Use runner.epoch + 1 in pavi log

* fix runner.epoch issue for runner.mode=='val'

* fix runner.epoch issue for runner.mode=='val'

* Use abspath instead of realpath

* Add meta dump unittest

* small change

* Add comments
2020-08-16 01:20:08 +08:00
Jintao Lin c8e85b28e4
Add `tin_shift` function (#492)
* add tin shift

* add unittest

* add docstring

* add docstring

* parrots for tin_shift

* fix lint

* fix lint

Co-authored-by: jiaomenglei <jiaomenglei@sensetime.com>
2020-08-15 22:29:07 +08:00
Yuanhao Zhu 51c65c97ec
fix syncbn parameter order mismatch and parrots bug (#488) 2020-08-13 19:27:05 +08:00
Kai Chen cac22f8cf5
Add pytorch 1.6 to CI (#476)
* add pytorch 1.6 to CI

* fix typo

* fix ci error

Co-authored-by: Cao Yuhang <yhcao6@gmail.com>
2020-08-09 21:56:15 +08:00
Jerry Jiarui XU 56e71a718b
Add Depthwise Seperable ConvModule (#477) 2020-08-09 17:29:02 +08:00
Jintao Lin 9de04d2284
Replace `re` with `regex` (#457)
* replace `re` with `regex`

* add regex in requirements

* use regex on windows and re on linux

* update requirements.txt
2020-08-03 11:45:50 +08:00
shilong 1830347f8b
Ema (#421)
* add ema hook

* add ema hook resume

* add ema hook test

* fix typo

* fix according to comment

* delete logger

* fix according to comment

* fix unitest

* fix typo

* fix according to comment

* change to resume_from

* typo

* fix isort
2020-07-30 22:06:19 +08:00
Wang Xinjiang d4da3daa7e
Syncbuf (#447)
* More robust sync buffer hook

* More robust sync buffer hook

* Reformat
2020-07-25 12:51:46 +08:00
Wang Xinjiang 66604e83de
Add syncbuffer hook (#443)
* reformat

* reformat

* Add register hook from cfg

* docstring

* change according to comments
2020-07-24 14:15:44 +08:00
Jiamin 55fadb4c4e
Add runner.meta to checkpoint in save_checkpoint() (#438)
* fix: error when runner.meta is None

* tests: add unittest for epoch-based save_checkpoint
2020-07-20 11:40:04 +08:00
Yawei Li 7730a79fcd
fix typo of annealing (#433) 2020-07-17 23:48:22 +08:00
Jintao Lin 6ece0e5d19
Add pairwise function for 'gaussian' and 'concatenation' mode in NonLocal. (#424)
* add pairwise function for 'gaussian' and 'concatenation' mode

* rename test function

* decrease the complexity of nonlocal unittest

* fix typo and make unittest more complete

* add unittest when zero_init is False

* minor fix

* pack theta and phi

Co-authored-by: Jiarui XU <xvjiarui0826@gmail.com>
2020-07-17 23:44:50 +08:00
Jerry Jiarui XU 9e3ff5f94c
Support pillow resize (#426)
* Support pillow resize

* add more types
2020-07-17 19:25:47 +08:00
Jerry Jiarui XU 4a044c6466
Support FP16 (#428)
* Support FP16

* update ci
2020-07-17 11:14:07 +08:00
Jerry Jiarui XU 7cfc839ea5
Add MMSyncBN in registry (#420)
* Add MMSyncBN in registery

* skip mmsyncbn test
2020-07-15 19:23:09 +08:00
Harry 5704613e28
Remove all module wrapper's module when saving checkpoint (#399)
* fix: remove all module wrapper when saving checkpoint

* refactor: move position of if

* docs: add docstring

* refactor: add _save_to_state_dict from official torch

* docs: modify docstring of _save_to_state_dict

* docs: modify docstring

* feat: add unittest

* feat: add DataParallel to unittest

* fix: a bug when model has batchnorm

* docs: update docstring
2020-07-08 23:20:22 +08:00
Joanna 27cc439d01
Update config to support predefined variables (#348)
* update config with predefined variables

* rm redun

Signed-off-by: lixuanyi <lixuanyi@sensetime.com>

* add test for config

Signed-off-by: lixuanyi <lixuanyi@sensetime.com>

* support all types

Signed-off-by: lixuanyi <lixuanyi@sensetime.com>

* newline at the end

Signed-off-by: lixuanyi <lixuanyi@sensetime.com>

* update

Signed-off-by: lixuanyi <lixuanyi@sensetime.com>

* extract code into a function and add docs

Signed-off-by: lixuanyi <lixuanyi@sensetime.com>

* fix and add tests

Signed-off-by: lixuanyi <lixuanyi@sensetime.com>

* add unit tests and fix

* fix

* fix minor

* fix test
2020-07-08 20:53:54 +08:00
Cao Yuhang 926ac07bb8
Move fuse conv bn to mmcv (#382)
* move fuse conv bn to mmcv

* update doc

* update test conv bn

* rename

* fix doc and variable name

* change func name
2020-07-08 19:03:15 +08:00
Cao Yuhang d5cbf7eed1
Migrate op (#392)
* migrate op

* migrate unittest

* update build no torch

* add back use_torch_vision for roi align

* fix type and unit test

* ignore test logging when no torch

* fix no torch ci test

* skip test registry

* remove coverage report when no torch

* fix mac ci order

* install latest pillow when no torch

* mv convws to brisk
2020-07-08 17:29:15 +08:00
Kai Chen 63b7aa31b6
Fix docstring formats (#383)
* update doc formats

* update docstring
2020-07-04 00:55:25 +08:00
Jerry Jiarui XU 42f03d84de
Refactor plugins: move from ops to cnn (#380)
* Refator plugins: move from ops to cnn

* minior update

* minior update
2020-07-03 01:37:58 +08:00
Xiaojie Li 82211b407e
Added new features to `impad` (#377)
* update impad

* fix docstring

* add shape for impad

* fix unit test

* remove old version & fix doc

* fix linting

* fix doc

Co-authored-by: lixiaojie <lixiaojie@sensetime.com>
2020-07-02 19:34:46 +08:00
Jerry Jiarui XU 9c51928b7c
Add tensor2imgs in misc (#374)
* add tensor2imgs in misc

* rename

* fixed import

* raise error
2020-07-02 00:14:50 +08:00
Jintao Lin 1ebd7ea6fb
add unittest for set_random_seed (#376) 2020-07-02 00:13:04 +08:00
Jerry Jiarui XU 0970ae94c2
Add cpu ops (#370)
* update actiion

* remove 1.3 cuda

* reorder

* add no torch

* fixed version

* make py3.8 on pt1.5

* make py3.8 on pt1.5

* remove torch 1.3

* disable py3.8

* pip

* merge master with cuda compile fix

* add cpu roi align

* fixed test

* fixed no torch

* add CUDA_ARGS

* use one line

* gencode=61

* seperate jobs

* update lint

* use parametrize test

* formart and rename

* unit test for all
2020-06-30 12:09:48 +08:00
louzana 2c6fc5fd9b
fix bug of building ConvModule with HSigmoid using inplace=True and a… (#369)
* fix bug of building ConvModule with HSigmoid using inplace=True and add corresponding unittest

* fix linting
2020-06-28 23:27:14 +08:00
zhuyuanhao c0f5492ee9
add ext ops, support parrots (#310)
* add ext ops, support parrots

* fix lint

* fix lint

* update op from mmdetection

* support non-pytorch env

* fix import bug

* test not import mmcv.op

* rename mmcv.op to mmcv.ops

* fix compile warning

* 1. fix syncbn warning in pytorch 1.5
2. support only cpu compile
3. add point_sample from mmdet

* fix text bug

* update docstrings

* fix line endings

* minor updates

* remove non_local from ops

* bug fix for nonlocal2d

* rename ops_ext to _ext and _ext to _flow_warp_ext

* update the doc

* try clang-format github action

* fix github action

* add ops to api.rst

* fix cpp format

* fix clang format issues

* remove .clang-format

Co-authored-by: Kai Chen <chenkaidev@gmail.com>
2020-06-28 23:15:47 +08:00
Jintao Lin 9bc0b96d02
Add utils to calculate model complexity and adjust folder structure for mmcv/cnn/utils . (#366)
* Add utils to calculate model complexity info

* remove _InstanceNorm in unittest

* add docstring and increase unittest coverage

* fix deconv_flops_counter_hook to accept different data shape

* test when model is not a common instance

* put flops_counter.py and weight_init.py into mmcv/cnn/utils folder

* fix import name

* reformat some docstrings

* update the scripts with latest one and remove redundant codes

* directly represent a model without string and eval()

* reformat code
2020-06-26 21:38:29 +08:00
Harry 69048ff056
Specifying distributed training port in os.environ when training with slurm (#362)
* feat: support for os.environ port for slurm training

* fix: port data type

* feat: add flawed unittest

* feat: add flawed unittest

* docs: add comments

* fix: unittest

* fix: unittest
2020-06-20 00:49:44 +08:00
louzana fef7b2fea4
add hswish and hsigmoid (#358)
* add hswish and hsigmoid

* fix linting

* fix linting

* delete useless staticmethod in cnn/bricks/hsigmoid.py

* forward(x) ==> forward(seld, x)

* add unittests for hsigmoid and hswish

* use torch.equal instead of numpy.equal
2020-06-19 21:35:17 +08:00
Harry 4808988117
Fix potential bug in DefaultOptimizerConstructor (#355)
* fix: fix custom_keys whenweight_decay is not specified

* docs: small fix

* feat: add type check

* refactor: move if outside for
2020-06-18 22:07:16 +08:00
Jintao Lin dcc20f3a4b
Add `_NonLocalNd` module (#331)
* add non_local module

* rewrite non local module comments

* perfect docstring and adjust init function

* not to init norm layer

* Correct initialize when there is a norm

* set normal method for both embedded_gaussian and dot_product
2020-06-18 20:56:48 +08:00
Kai Chen 6bb244f255
add train_step() and val_step() for MMDP (#354) 2020-06-18 20:55:53 +08:00
Harry c74d729d92
Add custom_group to DefaultOptimizerConstrutor (#347)
* feat: add custom_group to DefaultOptimConstrutor

* refactor: move custom_groups validate to _validate_cfg

* docs: add doc to explain custom_groups

* feat: add unittest for non_exist_key

* refactor: one param per group

* fix: small fix

* fix: name

* docs: docstring

* refactor: change to mult for only lr and wd custom

* docs: docstring

* docs: more explaination

* feat: sort custom key

* docs: add docstring

* refactor: use reverse arg of sorted

* docs: fix comment

* docs: fix comment

* refactor: small modi

* refactor: small modi

* refactor: small modi
2020-06-17 23:39:50 +08:00
Kai Chen 657f03ad08
replace DeprecationWarning with UserWarning (#353) 2020-06-17 20:52:48 +08:00
Harry 799421003d
Add module wrapper registry (#352)
* feat: modify parallel to module wrapper

* fix: unittest

* fix: add registry file

* feat: add module wrapper unittest
2020-06-17 20:12:54 +08:00
Jerry Jiarui XU c6784f4acf
add backend arg (#350)
* add backend arg

* add test

* update doc, add test

* update test

* update doc
2020-06-17 19:42:31 +08:00
Wang Xinjiang 630b747cb1
added pillow backend in loading (#333)
* added pillow backend in loading

* reformat

* remove auto fill for RGBA

* change according to comments

* change according to comments

* reformat
2020-06-17 10:25:48 +08:00
Harry f28a7c7ed7
Add CosineRestartLrUpdaterHook (#319)
* feat: add CosineRestartLrUpdaterHook

* style: rename period to periods

* fix: bug in period 0

* feat: rename eta_min to min_lr and add min_lr_ratio

* docs: fix docstring of restart lr updater

* refactor: use annealing_cos

* docs: add docstring to annealing_cos

* feat: cosine restart lr update hook

* refactor: modify code order for unittest
2020-06-15 23:01:26 +08:00
lizz 9f04477f93
Harmless changes (#340)
* harmless changes

Signed-off-by: lizz <lizz@sensetime.com>

* Update conv_module.py

* No bracket for simple class

Signed-off-by: lizz <lizz@sensetime.com>
2020-06-15 11:29:01 +08:00
lizz b87e774f66
Remove more unused things (#338)
* Remove more unused things

Signed-off-by: lizz <lizz@sensetime.com>

* panic

Signed-off-by: lizz <lizz@sensetime.com>
2020-06-13 20:19:30 +08:00
Jintao Lin 5a98f7e421
enalbe memcached support in PetrelBackend (#341) 2020-06-13 18:32:48 +08:00
Harry 67a26da917
Add IterBasedRunner (#314)
* feat: add IterBasedRunner

* fix: unittest

* feat: more unittest

* fix: expose dataloader len

* minor updates of BaseRunner

* refactor: remove CosineRestartLrUpdaterHook

* style: add docstring

* refactor: update IterTextLoggerHook: fstring and exp_name

* fix: epoch_runner unittest

* refactor: remove IterBasedTextLogger

* fix: old IterTextLoggerHook issue

* refactor: remove __len__ of IterLoader

* feat: add IterBasedRunner to init

* feat: add __len__ to IterLoader

* fix some docstrings

* refactor: use is_parallel_module

* fix: import issue

* fix: runner unittest missing logger

* fix checkpoints

* feat: add by_epoch default value to IterBaseRunner regitering loggger_hook

* refactor: remove setting by_epoch in log_config

* minor refactoring

* docs: add docstring

* fix: remove unused doc

* update the log info for saving checkpoints

Co-authored-by: Kai Chen <chenkaidev@gmail.com>
2020-06-11 13:35:34 +08:00
Jerry Jiarui XU 61f9e91c9f
Add syntax check in .py config (#330)
* Add syntax check in .py config

* rename validate
2020-06-10 23:07:59 +08:00
Jerry Jiarui XU 2aa7712cb7
add more act w.o. inplace opt (#329) 2020-06-10 15:42:09 +08:00
Kai Chen 821b3ad622
Fix the BC issue of ddp (#325)
* fix the BC issue of ddp

* minor fix for the docstring
2020-06-08 22:34:19 +08:00
Jerry Jiarui XU a3ae781789
add reserved key in config (#315) 2020-06-04 14:55:28 +08:00