* [Docs] add Chinese version of compatibility.md * [Docs] fix typo * [Docs] fix lint * [Docs] fix typo * [Docs] fix typo
3.2 KiB
Differences between MMSelfSup and OpenSelfSup
This file records differences between the newest version of MMSelfSup with older versions and OpenSelfSup.
MMSelfSup goes through a refactoring and addresses many legacy issues. It is not compatitible with OpenSelfSup, i.e. the old config files are supposed to be updated as some arguments of the class or names of the components have been modified.
The major differences are in two folds: codebase conventions, modular design.
Modular Design
In order to build more clear directory structure, MMSelfSup redesigns some of the modules.
Datasets
-
MMSelfSup merges some datasets to reduce some redundant codes.
-
Classification, Extraction, NPID -> OneViewDataset
-
BYOL, Contrastive -> MultiViewDataset
-
-
The
data_sourcesfolder has been refactored, thus the loading function is more robust.
In addition, this part is still under refactoring, it will be released in following version.
Models
-
The registry mechanism is updated. Currently, the parts under the
modelsfolder are built with a parent calledMMCV_MODELSthat is imported fromMMCV. Please check mmselfsup/models/builder.py and refer to mmcv/utils/registry.py for more details. -
The
modelsfolder includesalgorithms,backbones,necks,heads,memoriesand some required utils. Thealgorithmsintegrates the other main components to build the self-supervised learning algorithms, which is likeclassifiersinMMClsordetectorsinMMDet. -
In OpenSelfSup, the names of
necksare kind of confused and all in one file. Now, thenecksare refactored, managed with one folder and renamed for easier understanding. Please checkmmselfsup/models/necksfor more details.
Codebase Conventions
MMSelfSup renews codebase conventions as OpenSelfSup has not been updated for some time.
Configs
-
MMSelfSup renames all config files to use new name convention. Please refer to 0_config for more details.
-
In the configs, some arguments of the class or names of the components have been modified.
-
One algorithm name has been modified: MOCO -> MoCo
-
As all models' components inherit
BaseModulefromMMCV, the models are initialized withinit_cfg. Please use it to set your initialization. Besides,init_weightscan also be used. -
Please use new neck names to compose your algorithms, check it before write your own configs.
-
The normalization layers are all built with arguments
norm_cfg.
-
Scripts
-
The directory of
toolsis modified, thus it has more clear structure. It has several folders to manage different scripts. For example, it has two converter folders for models and data format. Besides, the benchmark related scripts are all inbenchmarksfolder, which has the same structure asconfigs/benchmarks. -
The arguments in
train.pyhas been updated. Two major modifications are listed below.-
Add
--cfg-optionsto modify the config from cmd arguments. -
Remove
--pretrainedand use--cfg-optionsto set the pretrained models.
-