[Fix] Fix dependency (#3136)

## Motivation

Change the dependency `mmcls` to `mmpretrain`

## Modification

- modify `mmcls` to `mmpretrain`
- modify CI requirements

## BC-breaking (Optional)

If users have installed mmcls but not install mmpretrain, it might raise some error.
This commit is contained in:
谢昕辰 2023-06-26 16:02:37 +08:00 committed by GitHub
parent d3f2922ff5
commit ffb7e2e239
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 23 additions and 22 deletions

View File

@ -61,9 +61,9 @@ jobs:
command: | command: |
pip install git+https://github.com/open-mmlab/mmengine.git@main pip install git+https://github.com/open-mmlab/mmengine.git@main
pip install -U openmim pip install -U openmim
mim install 'mmcv>=2.0.0rc4' mim install mmcv>=2.0.0
pip install mmcls==1.0.0rc6 pip install mmpretrain>=1.0.0rc7
pip install git+https://github.com/open-mmlab/mmdetection.git@main pip install mmdet>=3.0.0
pip install -r requirements/tests.txt -r requirements/optional.txt pip install -r requirements/tests.txt -r requirements/optional.txt
python -m pip install albumentations>=0.3.2 --no-binary qudida,albumentations python -m pip install albumentations>=0.3.2 --no-binary qudida,albumentations
- run: - run:
@ -101,15 +101,15 @@ jobs:
name: Build Docker image name: Build Docker image
command: | command: |
docker build .circleci/docker -t mmseg:gpu --build-arg PYTORCH=<< parameters.torch >> --build-arg CUDA=<< parameters.cuda >> --build-arg CUDNN=<< parameters.cudnn >> docker build .circleci/docker -t mmseg:gpu --build-arg PYTORCH=<< parameters.torch >> --build-arg CUDA=<< parameters.cuda >> --build-arg CUDNN=<< parameters.cudnn >>
docker run --gpus all -t -d -v /home/circleci/project:/mmseg -v /home/circleci/mmengine:/mmengine -v /home/circleci/mmclassification:/mmclassification -v /home/circleci/mmdetection:/mmdetection -w /mmseg --name mmseg mmseg:gpu docker run --gpus all -t -d -v /home/circleci/project:/mmseg -v /home/circleci/mmengine:/mmengine -v /home/circleci/mmpretrain:/mmpretrain -v /home/circleci/mmdetection:/mmdetection -w /mmseg --name mmseg mmseg:gpu
- run: - run:
name: Install mmseg dependencies name: Install mmseg dependencies
command: | command: |
docker exec mmseg pip install -e /mmengine docker exec mmseg pip install -e /mmengine
docker exec mmseg pip install -U openmim docker exec mmseg pip install -U openmim
docker exec mmseg mim install 'mmcv>=2.0.0rc4' docker exec mmseg mim install mmcv>=2.0.0
docker exec mmseg pip install mmcls==1.0.0rc6 docker exec mmseg pip install mmpretrain>=1.0.0rc7
docker exec mmseg mim install mmdet==3.0.0 docker exec mmseg mim install mmdet>=3.0.0
docker exec mmseg pip install -r requirements/tests.txt -r requirements/optional.txt docker exec mmseg pip install -r requirements/tests.txt -r requirements/optional.txt
docker exec mmseg python -m pip install albumentations>=0.3.2 --no-binary qudida,albumentations docker exec mmseg python -m pip install albumentations>=0.3.2 --no-binary qudida,albumentations
- run: - run:
@ -145,8 +145,8 @@ workflows:
- main - main
- build_cpu: - build_cpu:
name: minimum_version_cpu name: minimum_version_cpu
torch: 1.6.0 torch: 1.8.1
torchvision: 0.7.0 torchvision: 0.9.1
python: "3.7" python: "3.7"
requires: requires:
- lint - lint
@ -177,7 +177,7 @@ workflows:
jobs: jobs:
- build_cuda: - build_cuda:
name: minimum_version_gpu name: minimum_version_gpu
torch: 1.6.0 torch: 1.8.1
# Use double quotation mark to explicitly specify its type # Use double quotation mark to explicitly specify its type
# as string instead of number # as string instead of number
cuda: "10.1" cuda: "10.1"

View File

@ -4,7 +4,8 @@ checkpoint_file = 'https://download.openmmlab.com/mmclassification/v0/poolformer
# TODO: delete custom_imports after mmcls supports auto import # TODO: delete custom_imports after mmcls supports auto import
# please install mmcls>=1.0 # please install mmcls>=1.0
# import mmcls.models to trigger register_module in mmcls # import mmcls.models to trigger register_module in mmcls
custom_imports = dict(imports=['mmcls.models'], allow_failed_imports=False) custom_imports = dict(
imports=['mmpretrain.models'], allow_failed_imports=False)
data_preprocessor = dict( data_preprocessor = dict(
type='SegDataPreProcessor', type='SegDataPreProcessor',
mean=[123.675, 116.28, 103.53], mean=[123.675, 116.28, 103.53],
@ -16,7 +17,7 @@ model = dict(
type='EncoderDecoder', type='EncoderDecoder',
data_preprocessor=data_preprocessor, data_preprocessor=data_preprocessor,
backbone=dict( backbone=dict(
type='mmcls.PoolFormer', type='mmpretrain.PoolFormer',
arch='s12', arch='s12',
init_cfg=dict( init_cfg=dict(
type='Pretrained', checkpoint=checkpoint_file, prefix='backbone.'), type='Pretrained', checkpoint=checkpoint_file, prefix='backbone.'),

View File

@ -1,5 +1,5 @@
norm_cfg = dict(type='SyncBN', requires_grad=True) norm_cfg = dict(type='SyncBN', requires_grad=True)
custom_imports = dict(imports='mmcls.models', allow_failed_imports=False) custom_imports = dict(imports='mmpretrain.models', allow_failed_imports=False)
checkpoint_file = 'https://download.openmmlab.com/mmclassification/v0/convnext/downstream/convnext-base_3rdparty_32xb128-noema_in1k_20220301-2a0ee547.pth' # noqa checkpoint_file = 'https://download.openmmlab.com/mmclassification/v0/convnext/downstream/convnext-base_3rdparty_32xb128-noema_in1k_20220301-2a0ee547.pth' # noqa
data_preprocessor = dict( data_preprocessor = dict(
type='SegDataPreProcessor', type='SegDataPreProcessor',
@ -13,7 +13,7 @@ model = dict(
data_preprocessor=data_preprocessor, data_preprocessor=data_preprocessor,
pretrained=None, pretrained=None,
backbone=dict( backbone=dict(
type='mmcls.ConvNeXt', type='mmpretrain.ConvNeXt',
arch='base', arch='base',
out_indices=[0, 1, 2, 3], out_indices=[0, 1, 2, 3],
drop_path_rate=0.4, drop_path_rate=0.4,

View File

@ -9,7 +9,7 @@ checkpoint_file = 'https://download.openmmlab.com/mmclassification/v0/convnext/d
model = dict( model = dict(
data_preprocessor=data_preprocessor, data_preprocessor=data_preprocessor,
backbone=dict( backbone=dict(
type='mmcls.ConvNeXt', type='mmpretrain.ConvNeXt',
arch='base', arch='base',
out_indices=[0, 1, 2, 3], out_indices=[0, 1, 2, 3],
drop_path_rate=0.4, drop_path_rate=0.4,

View File

@ -9,7 +9,7 @@ checkpoint_file = 'https://download.openmmlab.com/mmclassification/v0/convnext/d
model = dict( model = dict(
data_preprocessor=data_preprocessor, data_preprocessor=data_preprocessor,
backbone=dict( backbone=dict(
type='mmcls.ConvNeXt', type='mmpretrain.ConvNeXt',
arch='large', arch='large',
out_indices=[0, 1, 2, 3], out_indices=[0, 1, 2, 3],
drop_path_rate=0.4, drop_path_rate=0.4,

View File

@ -8,7 +8,7 @@ checkpoint_file = 'https://download.openmmlab.com/mmclassification/v0/convnext/d
model = dict( model = dict(
data_preprocessor=data_preprocessor, data_preprocessor=data_preprocessor,
backbone=dict( backbone=dict(
type='mmcls.ConvNeXt', type='mmpretrain.ConvNeXt',
arch='small', arch='small',
out_indices=[0, 1, 2, 3], out_indices=[0, 1, 2, 3],
drop_path_rate=0.3, drop_path_rate=0.3,

View File

@ -8,7 +8,7 @@ checkpoint_file = 'https://download.openmmlab.com/mmclassification/v0/convnext/d
model = dict( model = dict(
data_preprocessor=data_preprocessor, data_preprocessor=data_preprocessor,
backbone=dict( backbone=dict(
type='mmcls.ConvNeXt', type='mmpretrain.ConvNeXt',
arch='tiny', arch='tiny',
out_indices=[0, 1, 2, 3], out_indices=[0, 1, 2, 3],
drop_path_rate=0.4, drop_path_rate=0.4,

View File

@ -9,7 +9,7 @@ checkpoint_file = 'https://download.openmmlab.com/mmclassification/v0/convnext/d
model = dict( model = dict(
data_preprocessor=data_preprocessor, data_preprocessor=data_preprocessor,
backbone=dict( backbone=dict(
type='mmcls.ConvNeXt', type='mmpretrain.ConvNeXt',
arch='xlarge', arch='xlarge',
out_indices=[0, 1, 2, 3], out_indices=[0, 1, 2, 3],
drop_path_rate=0.4, drop_path_rate=0.4,

View File

@ -39,7 +39,7 @@ Transformers have shown great potential in computer vision tasks. A common belie
- PoolFormer backbone needs to install [MMClassification](https://github.com/open-mmlab/mmclassification) first, which has abundant backbones for downstream tasks. - PoolFormer backbone needs to install [MMClassification](https://github.com/open-mmlab/mmclassification) first, which has abundant backbones for downstream tasks.
```shell ```shell
pip install "mmcls>=1.0.0rc0" pip install "mmpretrain>=1.0.0rc7"
``` ```
- The pretrained models could also be downloaded from [PoolFormer config of MMClassification](https://github.com/open-mmlab/mmclassification/tree/master/configs/poolformer). - The pretrained models could also be downloaded from [PoolFormer config of MMClassification](https://github.com/open-mmlab/mmclassification/tree/master/configs/poolformer).

View File

@ -8,7 +8,7 @@ The compatible MMSegmentation, MMCV and MMEngine versions are as below. Please i
| MMSegmentation version | MMCV version | MMEngine version | MMClassification (optional) version | MMDetection (optional) version | | MMSegmentation version | MMCV version | MMEngine version | MMClassification (optional) version | MMDetection (optional) version |
| :--------------------: | :----------------------------: | :---------------: | :---------------------------------: | :----------------------------: | | :--------------------: | :----------------------------: | :---------------: | :---------------------------------: | :----------------------------: |
| dev-1.x branch | mmcv >= 2.0.0rc4 | MMEngine >= 0.7.1 | mmcls==1.0.0rc6 | mmdet >= 3.0.0 | | dev-1.x branch | mmcv >= 2.0.0 | MMEngine >= 0.7.4 | mmpretrain>=1.0.0rc7 | mmdet >= 3.0.0 |
| main branch | mmcv >= 2.0.0rc4 | MMEngine >= 0.7.1 | mmcls==1.0.0rc6 | mmdet >= 3.0.0 | | main branch | mmcv >= 2.0.0rc4 | MMEngine >= 0.7.1 | mmcls==1.0.0rc6 | mmdet >= 3.0.0 |
| 1.0.0 | mmcv >= 2.0.0rc4 | MMEngine >= 0.7.1 | mmcls==1.0.0rc6 | mmdet >= 3.0.0 | | 1.0.0 | mmcv >= 2.0.0rc4 | MMEngine >= 0.7.1 | mmcls==1.0.0rc6 | mmdet >= 3.0.0 |
| 1.0.0rc6 | mmcv >= 2.0.0rc4 | MMEngine >= 0.5.0 | mmcls>=1.0.0rc0 | mmdet >= 3.0.0rc6 | | 1.0.0rc6 | mmcv >= 2.0.0rc4 | MMEngine >= 0.5.0 | mmcls>=1.0.0rc0 | mmdet >= 3.0.0rc6 |

View File

@ -8,7 +8,7 @@
| MMSegmentation version | MMCV version | MMEngine version | MMClassification (optional) version | MMDetection (optional) version | | MMSegmentation version | MMCV version | MMEngine version | MMClassification (optional) version | MMDetection (optional) version |
| :--------------------: | :----------------------------: | :---------------: | :---------------------------------: | :----------------------------: | | :--------------------: | :----------------------------: | :---------------: | :---------------------------------: | :----------------------------: |
| dev-1.x branch | mmcv >= 2.0.0rc4 | MMEngine >= 0.7.1 | mmcls==1.0.0rc6 | mmdet >= 3.0.0 | | dev-1.x branch | mmcv >= 2.0.0 | MMEngine >= 0.7.4 | mmpretrain>=1.0.0rc7 | mmdet >= 3.0.0 |
| main branch | mmcv >= 2.0.0rc4 | MMEngine >= 0.7.1 | mmcls==1.0.0rc6 | mmdet >= 3.0.0 | | main branch | mmcv >= 2.0.0rc4 | MMEngine >= 0.7.1 | mmcls==1.0.0rc6 | mmdet >= 3.0.0 |
| 1.0.0 | mmcv >= 2.0.0rc4 | MMEngine >= 0.7.1 | mmcls==1.0.0rc6 | mmdet >= 3.0.0 | | 1.0.0 | mmcv >= 2.0.0rc4 | MMEngine >= 0.7.1 | mmcls==1.0.0rc6 | mmdet >= 3.0.0 |
| 1.0.0rc6 | mmcv >= 2.0.0rc4 | MMEngine >= 0.5.0 | mmcls>=1.0.0rc0 | mmdet >= 3.0.0rc6 | | 1.0.0rc6 | mmcv >= 2.0.0rc4 | MMEngine >= 0.5.0 | mmcls>=1.0.0rc0 | mmdet >= 3.0.0rc6 |