Skip to content

Commit

Permalink
[Fix] Fix dependency (#3136)
Browse files Browse the repository at this point in the history
## 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.
  • Loading branch information
xiexinch committed Jun 26, 2023
1 parent d3f2922 commit ffb7e2e
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 22 deletions.
20 changes: 10 additions & 10 deletions .circleci/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ jobs:
command: |
pip install git+https://github.com/open-mmlab/mmengine.git@main
pip install -U openmim
mim install 'mmcv>=2.0.0rc4'
pip install mmcls==1.0.0rc6
pip install git+https://github.com/open-mmlab/mmdetection.git@main
mim install mmcv>=2.0.0
pip install mmpretrain>=1.0.0rc7
pip install mmdet>=3.0.0
pip install -r requirements/tests.txt -r requirements/optional.txt
python -m pip install albumentations>=0.3.2 --no-binary qudida,albumentations
- run:
Expand Down Expand Up @@ -101,15 +101,15 @@ jobs:
name: Build Docker image
command: |
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:
name: Install mmseg dependencies
command: |
docker exec mmseg pip install -e /mmengine
docker exec mmseg pip install -U openmim
docker exec mmseg mim install 'mmcv>=2.0.0rc4'
docker exec mmseg pip install mmcls==1.0.0rc6
docker exec mmseg mim install mmdet==3.0.0
docker exec mmseg mim install mmcv>=2.0.0
docker exec mmseg pip install mmpretrain>=1.0.0rc7
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 python -m pip install albumentations>=0.3.2 --no-binary qudida,albumentations
- run:
Expand Down Expand Up @@ -145,8 +145,8 @@ workflows:
- main
- build_cpu:
name: minimum_version_cpu
torch: 1.6.0
torchvision: 0.7.0
torch: 1.8.1
torchvision: 0.9.1
python: "3.7"
requires:
- lint
Expand Down Expand Up @@ -177,7 +177,7 @@ workflows:
jobs:
- build_cuda:
name: minimum_version_gpu
torch: 1.6.0
torch: 1.8.1
# Use double quotation mark to explicitly specify its type
# as string instead of number
cuda: "10.1"
Expand Down
5 changes: 3 additions & 2 deletions configs/_base_/models/fpn_poolformer_s12.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
# TODO: delete custom_imports after mmcls supports auto import
# please install mmcls>=1.0
# 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(
type='SegDataPreProcessor',
mean=[123.675, 116.28, 103.53],
Expand All @@ -16,7 +17,7 @@
type='EncoderDecoder',
data_preprocessor=data_preprocessor,
backbone=dict(
type='mmcls.PoolFormer',
type='mmpretrain.PoolFormer',
arch='s12',
init_cfg=dict(
type='Pretrained', checkpoint=checkpoint_file, prefix='backbone.'),
Expand Down
4 changes: 2 additions & 2 deletions configs/_base_/models/upernet_convnext.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
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
data_preprocessor = dict(
type='SegDataPreProcessor',
Expand All @@ -13,7 +13,7 @@
data_preprocessor=data_preprocessor,
pretrained=None,
backbone=dict(
type='mmcls.ConvNeXt',
type='mmpretrain.ConvNeXt',
arch='base',
out_indices=[0, 1, 2, 3],
drop_path_rate=0.4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
model = dict(
data_preprocessor=data_preprocessor,
backbone=dict(
type='mmcls.ConvNeXt',
type='mmpretrain.ConvNeXt',
arch='base',
out_indices=[0, 1, 2, 3],
drop_path_rate=0.4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
model = dict(
data_preprocessor=data_preprocessor,
backbone=dict(
type='mmcls.ConvNeXt',
type='mmpretrain.ConvNeXt',
arch='large',
out_indices=[0, 1, 2, 3],
drop_path_rate=0.4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
model = dict(
data_preprocessor=data_preprocessor,
backbone=dict(
type='mmcls.ConvNeXt',
type='mmpretrain.ConvNeXt',
arch='small',
out_indices=[0, 1, 2, 3],
drop_path_rate=0.3,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
model = dict(
data_preprocessor=data_preprocessor,
backbone=dict(
type='mmcls.ConvNeXt',
type='mmpretrain.ConvNeXt',
arch='tiny',
out_indices=[0, 1, 2, 3],
drop_path_rate=0.4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
model = dict(
data_preprocessor=data_preprocessor,
backbone=dict(
type='mmcls.ConvNeXt',
type='mmpretrain.ConvNeXt',
arch='xlarge',
out_indices=[0, 1, 2, 3],
drop_path_rate=0.4,
Expand Down
2 changes: 1 addition & 1 deletion configs/poolformer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

```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).
Expand Down
2 changes: 1 addition & 1 deletion docs/en/notes/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
| :--------------------: | :----------------------------: | :---------------: | :---------------------------------: | :----------------------------: |
| 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 |
| 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 |
Expand Down
2 changes: 1 addition & 1 deletion docs/zh_cn/notes/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

| 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 |
| 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 |
Expand Down

0 comments on commit ffb7e2e

Please sign in to comment.