mirror of
https://github.com/open-mmlab/mmclassification.git
synced 2025-06-03 21:53:55 +08:00
[Fix] Update CI (#1454)
* update ci * update window ci * update window ci * update window ci * update window ci * update window ci * update window ci * update window ci * update window ci * update window ci * update window ci * update window ci * ignore tests/test_tools.py
This commit is contained in:
parent
568188a6b0
commit
3a25b13eb3
@ -67,7 +67,7 @@ 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.0rc1'
|
mim install 'mmcv >= 2.0.0rc4'
|
||||||
pip install timm
|
pip install timm
|
||||||
pip install transformers
|
pip install transformers
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
@ -118,7 +118,7 @@ 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.0rc1'
|
mim install 'mmcv >= 2.0.0rc4'
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
python -c 'import mmcv; print(mmcv.__version__)'
|
python -c 'import mmcv; print(mmcv.__version__)'
|
||||||
- run:
|
- run:
|
||||||
@ -141,7 +141,7 @@ jobs:
|
|||||||
type: string
|
type: string
|
||||||
cuda:
|
cuda:
|
||||||
type: enum
|
type: enum
|
||||||
enum: ["11.1"]
|
enum: ["11.1", "11.7"]
|
||||||
cudnn:
|
cudnn:
|
||||||
type: integer
|
type: integer
|
||||||
default: 8
|
default: 8
|
||||||
@ -162,7 +162,7 @@ jobs:
|
|||||||
command: |
|
command: |
|
||||||
docker exec mmpretrain pip install -e /mmengine
|
docker exec mmpretrain pip install -e /mmengine
|
||||||
docker exec mmpretrain pip install -U openmim
|
docker exec mmpretrain pip install -U openmim
|
||||||
docker exec mmpretrain mim install 'mmcv >= 2.0.0rc1'
|
docker exec mmpretrain mim install 'mmcv >= 2.0.0rc4'
|
||||||
docker exec mmpretrain pip install -r requirements.txt
|
docker exec mmpretrain pip install -r requirements.txt
|
||||||
docker exec mmpretrain python -c 'import mmcv; print(mmcv.__version__)'
|
docker exec mmpretrain python -c 'import mmcv; print(mmcv.__version__)'
|
||||||
- run:
|
- run:
|
||||||
@ -208,7 +208,7 @@ workflows:
|
|||||||
- build_cpu_with_3rdparty:
|
- build_cpu_with_3rdparty:
|
||||||
name: maximum_version_cpu
|
name: maximum_version_cpu
|
||||||
torch: 2.0.0
|
torch: 2.0.0
|
||||||
torchvision: 0.15.0
|
torchvision: 0.15.1
|
||||||
python: 3.10.0
|
python: 3.10.0
|
||||||
requires:
|
requires:
|
||||||
- minimum_version_cpu
|
- minimum_version_cpu
|
||||||
@ -224,6 +224,13 @@ workflows:
|
|||||||
cuda: "11.1"
|
cuda: "11.1"
|
||||||
requires:
|
requires:
|
||||||
- hold
|
- hold
|
||||||
|
- build_cuda:
|
||||||
|
name: maximum_version_gpu
|
||||||
|
torch: 2.0.0
|
||||||
|
cuda: "11.7"
|
||||||
|
cudnn: 8
|
||||||
|
requires:
|
||||||
|
- hold
|
||||||
merge_stage_test:
|
merge_stage_test:
|
||||||
when:
|
when:
|
||||||
not:
|
not:
|
||||||
|
4
.github/workflows/deploy.yml
vendored
4
.github/workflows/deploy.yml
vendored
@ -7,9 +7,9 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: startsWith(github.event.ref, 'refs/tags')
|
if: startsWith(github.event.ref, 'refs/tags')
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- name: Set up Python 3.7
|
- name: Set up Python 3.7
|
||||||
uses: actions/setup-python@v2
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: 3.7
|
python-version: 3.7
|
||||||
- name: Build MMPretrain
|
- name: Build MMPretrain
|
||||||
|
4
.github/workflows/lint.yml
vendored
4
.github/workflows/lint.yml
vendored
@ -10,9 +10,9 @@ jobs:
|
|||||||
lint:
|
lint:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- name: Set up Python 3.7
|
- name: Set up Python 3.7
|
||||||
uses: actions/setup-python@v2
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: 3.7
|
python-version: 3.7
|
||||||
- name: Install pre-commit hook
|
- name: Install pre-commit hook
|
||||||
|
66
.github/workflows/pr_stage_test.yml
vendored
66
.github/workflows/pr_stage_test.yml
vendored
@ -18,7 +18,7 @@ concurrency:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-18.04
|
runs-on: ubuntu-22.04
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
python-version: [3.7]
|
python-version: [3.7]
|
||||||
@ -26,9 +26,9 @@ jobs:
|
|||||||
- torch: 1.8.1
|
- torch: 1.8.1
|
||||||
torchvision: 0.9.1
|
torchvision: 0.9.1
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- name: Set up Python ${{ matrix.python-version }}
|
- name: Set up Python ${{ matrix.python-version }}
|
||||||
uses: actions/setup-python@v2
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ matrix.python-version }}
|
||||||
- name: Upgrade pip
|
- name: Upgrade pip
|
||||||
@ -39,7 +39,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
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.0rc1'
|
mim install 'mmcv >= 2.0.0rc4'
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
- name: Build and install
|
- name: Build and install
|
||||||
run: pip install -e .
|
run: pip install -e .
|
||||||
@ -58,16 +58,64 @@ jobs:
|
|||||||
name: codecov-umbrella
|
name: codecov-umbrella
|
||||||
fail_ci_if_error: false
|
fail_ci_if_error: false
|
||||||
|
|
||||||
|
build_cu117:
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
container:
|
||||||
|
image: pytorch/pytorch:2.0.0-cuda11.7-cudnn8-devel
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
python-version: [3.9]
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Set up Python ${{ matrix.python-version }}
|
||||||
|
uses: actions/setup-python@v4
|
||||||
|
with:
|
||||||
|
python-version: ${{ matrix.python-version }}
|
||||||
|
- name: Upgrade pip
|
||||||
|
run: pip install pip --upgrade
|
||||||
|
- name: Fetch GPG keys
|
||||||
|
run: |
|
||||||
|
apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub
|
||||||
|
apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/7fa2af80.pub
|
||||||
|
- name: Install Python-dev
|
||||||
|
run: apt-get update && apt-get install -y python${{matrix.python-version}}-dev
|
||||||
|
if: ${{matrix.python-version != 3.9}}
|
||||||
|
- name: Install system dependencies
|
||||||
|
run: |
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y ffmpeg libsm6 libxext6 git ninja-build libglib2.0-0 libxrender-dev libc6 libc6-dev
|
||||||
|
- name: Install mmpretrain dependencies
|
||||||
|
run: |
|
||||||
|
pip install git+https://github.com/open-mmlab/mmengine.git@main
|
||||||
|
pip install -U openmim
|
||||||
|
mim install 'mmcv >= 2.0.0rc4'
|
||||||
|
pip install -r requirements.txt
|
||||||
|
- name: Build and install
|
||||||
|
run: pip install -e .
|
||||||
|
- name: Run unittests and generate coverage report
|
||||||
|
run: |
|
||||||
|
coverage run --branch --source mmpretrain -m pytest tests/ --ignore tests/test_tools.py
|
||||||
|
coverage xml
|
||||||
|
coverage report -m
|
||||||
|
- name: Upload coverage to Codecov
|
||||||
|
uses: codecov/codecov-action@v1.0.14
|
||||||
|
with:
|
||||||
|
file: ./coverage.xml
|
||||||
|
flags: unittests
|
||||||
|
env_vars: OS,PYTHON
|
||||||
|
name: codecov-umbrella
|
||||||
|
fail_ci_if_error: false
|
||||||
|
|
||||||
build_windows:
|
build_windows:
|
||||||
runs-on: windows-2022
|
runs-on: windows-2022
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
python: [3.7]
|
python-version: [3.7]
|
||||||
platform: [cpu]
|
platform: [cpu]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- name: Set up Python ${{ matrix.python-version }}
|
- name: Set up Python ${{ matrix.python-version }}
|
||||||
uses: actions/setup-python@v2
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ matrix.python-version }}
|
||||||
- name: Upgrade pip
|
- name: Upgrade pip
|
||||||
@ -78,10 +126,10 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
pip install -U openmim
|
pip install -U openmim
|
||||||
mim install mmengine
|
mim install mmengine
|
||||||
mim install 'mmcv >= 2.0.0rc1'
|
mim install 'mmcv >= 2.0.0rc4'
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
- name: Build and install
|
- name: Build and install
|
||||||
run: pip install -e .
|
run: pip install -e . -v
|
||||||
- name: Run unittests
|
- name: Run unittests
|
||||||
run: |
|
run: |
|
||||||
pytest tests/ --ignore tests/test_models/test_backbones
|
pytest tests/ --ignore tests/test_models/test_backbones
|
||||||
|
4
.github/workflows/publish-to-pypi.yml
vendored
4
.github/workflows/publish-to-pypi.yml
vendored
@ -7,9 +7,9 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: startsWith(github.event.ref, 'refs/tags')
|
if: startsWith(github.event.ref, 'refs/tags')
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- name: Set up Python 3.7
|
- name: Set up Python 3.7
|
||||||
uses: actions/setup-python@v2
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: 3.7
|
python-version: 3.7
|
||||||
- name: Build MMPretrain
|
- name: Build MMPretrain
|
||||||
|
6
.github/workflows/test_mim.yml
vendored
6
.github/workflows/test_mim.yml
vendored
@ -17,7 +17,7 @@ concurrency:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build_cpu:
|
build_cpu:
|
||||||
runs-on: ubuntu-18.04
|
runs-on: ubuntu-22.04
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
python-version: [3.7]
|
python-version: [3.7]
|
||||||
@ -27,9 +27,9 @@ jobs:
|
|||||||
torch_version: torch1.8
|
torch_version: torch1.8
|
||||||
torchvision: 0.9.0
|
torchvision: 0.9.0
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- name: Set up Python ${{ matrix.python-version }}
|
- name: Set up Python ${{ matrix.python-version }}
|
||||||
uses: actions/setup-python@v2
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ matrix.python-version }}
|
||||||
- name: Upgrade pip
|
- name: Upgrade pip
|
||||||
|
@ -6,8 +6,8 @@ from mmengine.utils import digit_version
|
|||||||
from .apis import * # noqa: F401, F403
|
from .apis import * # noqa: F401, F403
|
||||||
from .version import __version__
|
from .version import __version__
|
||||||
|
|
||||||
mmcv_minimum_version = '2.0.0rc1'
|
mmcv_minimum_version = '2.0.0rc4'
|
||||||
mmcv_maximum_version = '2.0.0'
|
mmcv_maximum_version = '2.1.0'
|
||||||
mmcv_version = digit_version(mmcv.__version__)
|
mmcv_version = digit_version(mmcv.__version__)
|
||||||
|
|
||||||
mmengine_minimum_version = '0.5.0'
|
mmengine_minimum_version = '0.5.0'
|
||||||
|
@ -55,7 +55,7 @@ class TestAnalyzeLogs(TestCase):
|
|||||||
'python',
|
'python',
|
||||||
'tools/analysis_tools/analyze_logs.py',
|
'tools/analysis_tools/analyze_logs.py',
|
||||||
'cal_train_time',
|
'cal_train_time',
|
||||||
self.log_file,
|
str(self.log_file),
|
||||||
]
|
]
|
||||||
p = Popen(command, cwd=MMPRE_ROOT, stdout=PIPE)
|
p = Popen(command, cwd=MMPRE_ROOT, stdout=PIPE)
|
||||||
out, _ = p.communicate()
|
out, _ = p.communicate()
|
||||||
@ -65,7 +65,7 @@ class TestAnalyzeLogs(TestCase):
|
|||||||
'python',
|
'python',
|
||||||
'tools/analysis_tools/analyze_logs.py',
|
'tools/analysis_tools/analyze_logs.py',
|
||||||
'plot_curve',
|
'plot_curve',
|
||||||
self.log_file,
|
str(self.log_file),
|
||||||
'--keys',
|
'--keys',
|
||||||
'accuracy/top1',
|
'accuracy/top1',
|
||||||
'--out',
|
'--out',
|
||||||
@ -113,10 +113,10 @@ class TestAnalyzeResults(TestCase):
|
|||||||
command = [
|
command = [
|
||||||
'python',
|
'python',
|
||||||
'tools/analysis_tools/analyze_results.py',
|
'tools/analysis_tools/analyze_results.py',
|
||||||
self.config_file,
|
str(self.config_file),
|
||||||
self.result_file,
|
str(self.result_file),
|
||||||
'--out-dir',
|
'--out-dir',
|
||||||
self.tmpdir.name,
|
str(self.tmpdir.name),
|
||||||
]
|
]
|
||||||
p = Popen(command, cwd=MMPRE_ROOT, stdout=PIPE)
|
p = Popen(command, cwd=MMPRE_ROOT, stdout=PIPE)
|
||||||
p.communicate()
|
p.communicate()
|
||||||
@ -137,7 +137,7 @@ class TestPrintConfig(TestCase):
|
|||||||
command = [
|
command = [
|
||||||
'python',
|
'python',
|
||||||
'tools/misc/print_config.py',
|
'tools/misc/print_config.py',
|
||||||
self.config_file,
|
str(self.config_file),
|
||||||
]
|
]
|
||||||
p = Popen(command, cwd=MMPRE_ROOT, stdout=PIPE)
|
p = Popen(command, cwd=MMPRE_ROOT, stdout=PIPE)
|
||||||
out, _ = p.communicate()
|
out, _ = p.communicate()
|
||||||
@ -170,9 +170,9 @@ class TestVerifyDataset(TestCase):
|
|||||||
command = [
|
command = [
|
||||||
'python',
|
'python',
|
||||||
'tools/misc/verify_dataset.py',
|
'tools/misc/verify_dataset.py',
|
||||||
self.config_file,
|
str(self.config_file),
|
||||||
'--out-path',
|
'--out-path',
|
||||||
self.dir / 'log.log',
|
str(self.dir / 'log.log'),
|
||||||
]
|
]
|
||||||
p = Popen(command, cwd=MMPRE_ROOT, stdout=PIPE)
|
p = Popen(command, cwd=MMPRE_ROOT, stdout=PIPE)
|
||||||
out, _ = p.communicate()
|
out, _ = p.communicate()
|
||||||
@ -204,7 +204,7 @@ class TestEvalMetric(TestCase):
|
|||||||
command = [
|
command = [
|
||||||
'python',
|
'python',
|
||||||
'tools/analysis_tools/eval_metric.py',
|
'tools/analysis_tools/eval_metric.py',
|
||||||
self.result_file,
|
str(self.result_file),
|
||||||
'--metric',
|
'--metric',
|
||||||
'type=Accuracy',
|
'type=Accuracy',
|
||||||
'topk=1,2',
|
'topk=1,2',
|
||||||
@ -244,7 +244,7 @@ class TestVisScheduler(TestCase):
|
|||||||
command = [
|
command = [
|
||||||
'python',
|
'python',
|
||||||
'tools/visualization/vis_scheduler.py',
|
'tools/visualization/vis_scheduler.py',
|
||||||
self.config_file,
|
str(self.config_file),
|
||||||
'--dataset-size',
|
'--dataset-size',
|
||||||
'100',
|
'100',
|
||||||
'--not-show',
|
'--not-show',
|
||||||
@ -280,8 +280,8 @@ class TestPublishModel(TestCase):
|
|||||||
command = [
|
command = [
|
||||||
'python',
|
'python',
|
||||||
'tools/model_converters/publish_model.py',
|
'tools/model_converters/publish_model.py',
|
||||||
self.ckpt_file,
|
str(self.ckpt_file),
|
||||||
self.ckpt_file,
|
str(self.ckpt_file),
|
||||||
'--dataset-type',
|
'--dataset-type',
|
||||||
'ImageNet',
|
'ImageNet',
|
||||||
'--no-ema',
|
'--no-ema',
|
||||||
@ -318,11 +318,11 @@ class TestVisCam(TestCase):
|
|||||||
command = [
|
command = [
|
||||||
'python',
|
'python',
|
||||||
'tools/visualization/vis_cam.py',
|
'tools/visualization/vis_cam.py',
|
||||||
ASSETS_ROOT / 'color.jpg',
|
str(ASSETS_ROOT / 'color.jpg'),
|
||||||
self.config_file,
|
str(self.config_file),
|
||||||
self.ckpt_file,
|
str(self.ckpt_file),
|
||||||
'--save-path',
|
'--save-path',
|
||||||
self.dir / 'cam.jpg',
|
str(self.dir / 'cam.jpg'),
|
||||||
]
|
]
|
||||||
p = Popen(command, cwd=MMPRE_ROOT, stdout=PIPE)
|
p = Popen(command, cwd=MMPRE_ROOT, stdout=PIPE)
|
||||||
out, _ = p.communicate()
|
out, _ = p.communicate()
|
||||||
@ -354,10 +354,10 @@ class TestConfusionMatrix(TestCase):
|
|||||||
command = [
|
command = [
|
||||||
'python',
|
'python',
|
||||||
'tools/analysis_tools/confusion_matrix.py',
|
'tools/analysis_tools/confusion_matrix.py',
|
||||||
self.config_file,
|
str(self.config_file),
|
||||||
self.result_file,
|
str(self.result_file),
|
||||||
'--out',
|
'--out',
|
||||||
self.dir / 'result.pkl',
|
str(self.dir / 'result.pkl'),
|
||||||
]
|
]
|
||||||
Popen(command, cwd=MMPRE_ROOT, stdout=PIPE).wait()
|
Popen(command, cwd=MMPRE_ROOT, stdout=PIPE).wait()
|
||||||
result = mmengine.load(self.dir / 'result.pkl')
|
result = mmengine.load(self.dir / 'result.pkl')
|
||||||
@ -396,9 +396,9 @@ class TestVisTsne(TestCase):
|
|||||||
command = [
|
command = [
|
||||||
'python',
|
'python',
|
||||||
'tools/visualization/vis_tsne.py',
|
'tools/visualization/vis_tsne.py',
|
||||||
self.config_file,
|
str(self.config_file),
|
||||||
'--work-dir',
|
'--work-dir',
|
||||||
self.dir,
|
str(self.dir),
|
||||||
'--perplexity',
|
'--perplexity',
|
||||||
'2',
|
'2',
|
||||||
]
|
]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user