Skip to content
Snippets Groups Projects
Unverified Commit 78fda0ac authored by Kai Chen's avatar Kai Chen Committed by GitHub
Browse files

Update to pytorch 1.3.1 and 1.5.1 in CI (#3413)

* update to pytorch 1.3.1 and 1.5.1 in CI

* add build_cpu and lint jobs

* add missing dependencies

* fix mmcv version

* fix variable name

* add missing dependencies
parent 7ac6ebee
No related branches found
No related tags found
No related merge requests found
...@@ -3,24 +3,66 @@ name: build ...@@ -3,24 +3,66 @@ name: build
on: [push, pull_request] on: [push, pull_request]
jobs: jobs:
build: lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install pre-commit hook
run: |
pip install pre-commit
pre-commit install
- name: Linting
run: pre-commit run --all-files
- name: Check docstring coverage
run: |
pip install interrogate
interrogate -v --ignore-init-method --ignore-module --ignore-nested-functions --ignore-regex "__repr__" --fail-under 80 mmdet
build_cpu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install PyTorch
run: pip install torch==1.5.1+cpu torchvision==0.6.1+cpu -f https://download.pytorch.org/whl/torch_stable.html
- name: Install MMCV
run: pip install mmcv-full==latest+torch1.5.0+cpu -f https://openmmlab.oss-accelerate.aliyuncs.com/mmcv/dist/index.html
- name: Install unittest dependencies
run: pip install -r requirements/tests.txt -r requirements/optional.txt
- name: Build and install
run: rm -rf .eggs && pip install -e .
- name: Run unittests and generate coverage report
run: |
coverage run --branch --source mmdet -m pytest tests/
coverage xml
coverage report -m
build_cuda:
runs-on: ubuntu-latest runs-on: ubuntu-latest
env: env:
CUDA: 10.1.105-1 CUDA: 10.1.105-1
CUDA_SHORT: 10.1 CUDA_SHORT: 10.1
UBUNTU_VERSION: ubuntu1804 UBUNTU_VERSION: ubuntu1804
FORCE_CUDA: 1
strategy: strategy:
matrix: matrix:
python-version: [3.6, 3.7] python-version: [3.6, 3.7]
torch: [1.3.0, 1.5.0] torch: [1.3.1, 1.5.1]
include: include:
- torch: 1.3.0 - torch: 1.3.1
torchvision: 0.4.2 torchvision: 0.4.2
mmcv: "latest+torch1.3.0+cu101"
cuda_arch: "6.0" cuda_arch: "6.0"
- torch: 1.5.0 - torch: 1.5.1
torchvision: 0.6.0 torchvision: 0.6.1
mmcv: "latest+torch1.5.0+cu101"
cuda_arch: "7.0" cuda_arch: "7.0"
steps: steps:
...@@ -42,7 +84,6 @@ jobs: ...@@ -42,7 +84,6 @@ jobs:
export CUDA_HOME=/usr/local/cuda-${CUDA_SHORT} export CUDA_HOME=/usr/local/cuda-${CUDA_SHORT}
export LD_LIBRARY_PATH=${CUDA_HOME}/lib64:${CUDA_HOME}/include:${LD_LIBRARY_PATH} export LD_LIBRARY_PATH=${CUDA_HOME}/lib64:${CUDA_HOME}/include:${LD_LIBRARY_PATH}
export PATH=${CUDA_HOME}/bin:${PATH} export PATH=${CUDA_HOME}/bin:${PATH}
sudo apt-get install -y ninja-build
- name: Install Pillow - name: Install Pillow
run: pip install Pillow==6.2.2 run: pip install Pillow==6.2.2
if: ${{matrix.torchvision < 0.5}} if: ${{matrix.torchvision < 0.5}}
...@@ -50,24 +91,13 @@ jobs: ...@@ -50,24 +91,13 @@ jobs:
run: pip install torch==${{matrix.torch}} torchvision==${{matrix.torchvision}} run: pip install torch==${{matrix.torch}} torchvision==${{matrix.torchvision}}
- name: Install mmdet dependencies - name: Install mmdet dependencies
run: | run: |
pip install mmcv-full==latest+torch${{matrix.torch}}+cu101 -f https://openmmlab.oss-accelerate.aliyuncs.com/mmcv/dist/index.html pip install mmcv-full==${{matrix.mmcv}} -f https://openmmlab.oss-accelerate.aliyuncs.com/mmcv/dist/index.html
pip install -r requirements.txt pip install -r requirements.txt
- name: Lint with flake8
run: flake8 .
- name: Lint with isort
run: isort --recursive --check-only --diff mmdet/ tools/ tests/
- name: Format with yapf
run: yapf -r -d mmdet/ tools/ configs/ tests/
- name: Check docstring
run: interrogate -v --ignore-init-method --ignore-module --ignore-nested-functions --ignore-regex "__repr__" --fail-under 80 mmdet
- name: Build and install - name: Build and install
env:
CUDA_ARCH: ${{matrix.cuda_arch}}
run: | run: |
rm -rf .eggs rm -rf .eggs
python setup.py check -m -s python setup.py check -m -s
TORCH_CUDA_ARCH_LIST=${CUDA_ARCH} python setup.py build_ext --inplace TORCH_CUDA_ARCH_LIST=${{matrix.cuda_arch}} pip install .
- name: Run unittests and generate coverage report - name: Run unittests and generate coverage report
run: | run: |
coverage run --branch --source mmdet -m pytest tests/ coverage run --branch --source mmdet -m pytest tests/
......
...@@ -103,7 +103,6 @@ def make_cuda_ext(name, module, sources, sources_cuda=[]): ...@@ -103,7 +103,6 @@ def make_cuda_ext(name, module, sources, sources_cuda=[]):
else: else:
print(f'Compiling {name} without CUDA') print(f'Compiling {name} without CUDA')
extension = CppExtension extension = CppExtension
# raise EnvironmentError('CUDA is required to compile MMDetection!')
return extension( return extension(
name=f'{module}.{name}', name=f'{module}.{name}',
...@@ -195,21 +194,21 @@ if __name__ == '__main__': ...@@ -195,21 +194,21 @@ if __name__ == '__main__':
setup( setup(
name='mmdet', name='mmdet',
version=get_version(), version=get_version(),
description='Open MMLab Detection Toolbox and Benchmark', description='OpenMMLab Detection Toolbox and Benchmark',
long_description=readme(), long_description=readme(),
author='OpenMMLab', author='OpenMMLab',
author_email='chenkaidev@gmail.com', author_email='openmmlab@gmail.com',
keywords='computer vision, object detection', keywords='computer vision, object detection',
url='https://github.com/open-mmlab/mmdetection', url='https://github.com/open-mmlab/mmdetection',
packages=find_packages(exclude=('configs', 'tools', 'demo')), packages=find_packages(exclude=('configs', 'tools', 'demo')),
classifiers=[ classifiers=[
'Development Status :: 4 - Beta', 'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: Apache Software License', 'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independent', 'Operating System :: OS Independent',
'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
], ],
license='Apache License 2.0', license='Apache License 2.0',
setup_requires=parse_requirements('requirements/build.txt'), setup_requires=parse_requirements('requirements/build.txt'),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment