Skip to content

Commit

Permalink
Merge tag 'v1.1.5' into viame/next
Browse files Browse the repository at this point in the history
* tag 'v1.1.5': (81 commits)
  bump version to 1.1.5 (open-mmlab#603)
  Fix wrappers version comparison (open-mmlab#602)
  revert dcn (open-mmlab#597)
  lint markdown files (open-mmlab#592)
  bump version to 1.1.4 (open-mmlab#591)
  fix lint open-mmlab#580 (open-mmlab#590)
  Fixed fp16_optimizer state bug (open-mmlab#580)
  register deconv in CONV_LAYERS (open-mmlab#582)
  [enhance]: show grad norm in fp16 optimizer hook (open-mmlab#584)
  [Enhance] Switch to https://download.openmmlab.com (open-mmlab#583)
  Support to specify LR of DCN's conv_offset (open-mmlab#344)
  add torchvision roi_align with aligned=True (open-mmlab#581)
  Add runner builder (open-mmlab#570)
  [fix]: fix wrapper comparison of pytorch version (open-mmlab#572)
  Add missing by_epoch arg (open-mmlab#576)
  merge the calling of train/val_step and batch_processor into run_iter (open-mmlab#553)
  bump version to 1.1.3 (open-mmlab#569)
  fix deprecated wrappers exiting bug (open-mmlab#567)
  add switch for onnx exporter (open-mmlab#564)
  fix dcon forward and backward bug (open-mmlab#565)
  ...
  • Loading branch information
mattdawkins committed Dec 3, 2020
2 parents 78d6531 + 665fee2 commit c6cf6e2
Show file tree
Hide file tree
Showing 107 changed files with 2,921 additions and 522 deletions.
99 changes: 55 additions & 44 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,34 +14,54 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install linting dependencies
- name: Install pre-commit hook
run: |
python -m pip install --upgrade pip
pip install flake8 yapf isort==4.3.21
- name: Lint with flake8
run: flake8 --max-complexity 20 .
- name: Lint with isort
run: isort --recursive --check-only --diff mmcv/ tests/ examples/
- name: Format python codes with yapf
run: yapf -r -d mmcv/ tests/ examples/
pip install pre-commit
pre-commit install
- name: Linting
run: pre-commit run --all-files
- name: Format c/cuda codes with clang-format
uses: DoozyX/clang-format-lint-action@v0.6
with:
source: mmcv/ops/csrc
extensions: h,c,cpp,hpp,cu,cuh
style: google

build_without_torch:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y ffmpeg libturbojpeg
- name: Install unittest dependencies
run: pip install pytest coverage lmdb PyTurboJPEG
- name: Build and install
run: rm -rf .eggs && pip install -e .
- name: Install Pillow
run: pip install Pillow
- name: Run unittests and generate coverage report
run: |
pytest tests/ --ignore=tests/test_runner --ignore=tests/test_optimizer.py --ignore=tests/test_cnn --ignore=tests/test_parallel.py --ignore=tests/test_ops --ignore=tests/test_load_model_zoo.py --ignore=tests/test_utils/test_logging.py --ignore=tests/test_image/test_io.py --ignore=tests/test_utils/test_registry.py
build_without_ops:
runs-on: ubuntu-latest
env:
MMCV_WITH_OPS: 0
strategy:
matrix:
python-version: [3.7]
torch: [1.5.1]
torch: [1.6.0]
include:
- torch: 1.5.1
torchvision: 0.6.1
- torch: 1.6.0
torchvision: 0.7.0
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -67,10 +87,16 @@ jobs:
strategy:
matrix:
python-version: [3.7]
torch: [1.4.0]
torch: [1.3.1, 1.4.0, 1.5.1, 1.6.0]
include:
- torch: 1.4.0
- torch: 1.3.1
torchvision: 0.4.2
- torch: 1.4.0
torchvision: 0.5.0
- torch: 1.5.1
torchvision: 0.6.1
- torch: 1.6.0
torchvision: 0.7.0
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
Expand Down Expand Up @@ -104,16 +130,21 @@ jobs:
MMCV_CUDA_ARGS: -gencode=arch=compute_61,code=sm_61
strategy:
matrix:
python-version: [3.6, 3.7]
torch: [1.3.1, 1.5.1+cu101]
python-version: [3.7]
torch: [1.3.1, 1.5.1+cu101, 1.6.0+cu101]
include:
- torch: 1.3.1
torchvision: 0.4.2
- torch: 1.5.1+cu101
torchvision: 0.6.1+cu101
- torch: 1.6.0+cu101
torchvision: 0.7.0+cu101
- python-version: 3.6
torch: 1.6.0+cu101
torchvision: 0.7.0+cu101
- python-version: 3.8
torch: 1.5.1+cu101
torchvision: 0.6.1+cu101
torch: 1.6.0+cu101
torchvision: 0.7.0+cu101

steps:
- uses: actions/checkout@v2
Expand All @@ -132,6 +163,8 @@ jobs:
sudo apt install -y cuda-${CUDA_SHORT/./-} cuda-cufft-dev-${CUDA_SHORT/./-}
sudo apt clean
export CUDA_HOME=/usr/local/cuda-${CUDA_SHORT}
sudo cp /usr/local/cuda-10.2/include/* /usr/local/cuda/include
sudo cp -r /usr/local/cuda-10.2/lib64/* /usr/local/cuda/lib64/
export LD_LIBRARY_PATH=${CUDA_HOME}/lib64:${CUDA_HOME}/include:${LD_LIBRARY_PATH}
export PATH=${CUDA_HOME}/bin:${PATH}
sudo apt-get install -y ninja-build
Expand Down Expand Up @@ -162,40 +195,18 @@ jobs:
name: codecov-umbrella
fail_ci_if_error: false

build_no_torch:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y ffmpeg libturbojpeg
- name: Install unittest dependencies
run: pip install pytest coverage lmdb PyTurboJPEG
- name: Build and install
run: rm -rf .eggs && pip install -e .
- name: Install Pillow
run: pip install Pillow
- name: Run unittests and generate coverage report
run: |
pytest tests/ --ignore=tests/test_runner --ignore=tests/test_optimizer.py --ignore=tests/test_cnn --ignore=tests/test_parallel.py --ignore=tests/test_ops --ignore=tests/test_load_model_zoo.py --ignore=tests/test_logging.py --ignore=tests/test_image/test_io.py --ignore=tests/test_registry.py --ignore=tests/test_fp16.py
build_macos:
runs-on: macos-latest
strategy:
matrix:
torch: [1.5.1, 1.3.1]
torch: [1.3.1, 1.5.1, 1.6.0]
include:
- torch: 1.3.1
torchvision: 0.4.2
- torch: 1.5.1
torchvision: 0.6.1
- torch: 1.6.0
torchvision: 0.7.0
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
Expand All @@ -218,4 +229,4 @@ jobs:
- name: Run unittests
run: |
# The timing on macos VMs is not precise, so we skip the progressbar tests
pytest tests/ --ignore tests/test_progressbar.py --ignore tests/test_timer.py
pytest tests/ --ignore tests/test_utils/test_progressbar.py --ignore tests/test_utils/test_timer.py
21 changes: 13 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,21 @@ repos:
args: ["--remove"]
- id: mixed-line-ending
args: ["--fix=lf"]
- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 2.1.4
hooks:
- id: markdownlint
args: ["-r", "~MD002,~MD013,~MD029,~MD033,~MD034"]
- repo: https://github.com/myint/docformatter
rev: v1.3.1
hooks:
- id: docformatter
args: ["--in-place", "--wrap-descriptions", "79"]
- repo: local
hooks:
- id: clang-format
name: clang-format
description: Format files with ClangFormat
entry: clang-format -style=google -i
language: system
files: \.(c|cc|cxx|cpp|cu|h|hpp|hxx|cuh|proto)$
# - repo: local
# hooks:
# - id: clang-format
# name: clang-format
# description: Format files with ClangFormat
# entry: clang-format -style=google -i
# language: system
# files: \.(c|cc|cxx|cpp|cu|h|hpp|hxx|cuh|proto)$
9 changes: 6 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ Note: If you plan to add some new features that involve large changes, it is enc
## Code style

### Python

We adopt [PEP8](https://www.python.org/dev/peps/pep-0008/) as the preferred code style.

We use the following tools for linting and formatting:

- [flake8](http://flake8.pycqa.org/en/latest/): linter
- [yapf](https://github.com/google/yapf): formatter
- [isort](https://github.com/timothycrosley/isort): sort imports
Expand All @@ -32,19 +34,20 @@ The config for a pre-commit hook is stored in [.pre-commit-config](./.pre-commit

After you clone the repository, you will need to install initialize pre-commit hook.

```
```shell
pip install -U pre-commit
```

From the repository folder
```

```shell
pre-commit install
```

After this on every commit check code linters and formatter will be enforced.


>Before you create a PR, make sure that your code lints and is formatted by yapf.
### C++ and CUDA

We follow the [Google C++ Style Guide](https://google.github.io/styleguide/cppguide.html).
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include mmcv/video/optflow_warp/*.hpp mmcv/video/optflow_warp/*.pyx
include requirements.txt
include mmcv/model_zoo/open_mmlab.json mmcv/model_zoo/deprecated.json
include mmcv/model_zoo/open_mmlab.json mmcv/model_zoo/deprecated.json mmcv/model_zoo/mmcls.json
include mmcv/ops/csrc/*.cuh mmcv/ops/csrc/*.hpp
include mmcv/ops/csrc/pytorch/*.cu mmcv/ops/csrc/pytorch/*.cpp
include mmcv/ops/csrc/parrots/*.cu mmcv/ops/csrc/parrots/*.cpp
71 changes: 52 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,23 +54,39 @@ Before installing mmcv-full, make sure that PyTorch has been successfully instal

We provide pre-built mmcv packages (recommended) with different PyTorch and CUDA versions to simplify the building.

<table class="docutils"><tbody><tr><th width="80"> CUDA </th><th valign="bottom" align="left" width="100">torch 1.5</th><th valign="bottom" align="left" width="100">torch 1.4</th><th valign="bottom" align="left" width="100">torch 1.3</th></tr>
<tr><td align="left">10.2</td><td align="left"><details><summary> install </summary><pre><code>pip install mmcv-full==latest+torch1.5.0+cu102 -f https://openmmlab.oss-accelerate.aliyuncs.com/mmcv/dist/index.html
</code></pre> </details> </td> <td align="left"> </td> <td align="left"> </td> </tr>
<tr><td align="left">10.1</td><td align="left"><details><summary> install </summary><pre><code> pip install mmcv-full==latest+torch1.5.0+cu101 -f https://openmmlab.oss-accelerate.aliyuncs.com/mmcv/dist/index.html
</code></pre> </details> </td> <td align="left"><details><summary> install </summary><pre><code>pip install mmcv-full==latest+torch1.4.0+cu101 -f https://openmmlab.oss-accelerate.aliyuncs.com/mmcv/dist/index.html
</code></pre> </details> </td> <td align="left"><details><summary> install </summary><pre><code>pip install mmcv-full==latest+torch1.3.0+cu101 -f https://openmmlab.oss-accelerate.aliyuncs.com/mmcv/dist/index.html
</code></pre> </details> </td></tr>
<tr><td align="left">10.0</td><td align="left"> </td><td align="left"> </td> <td align="left"> </td> </tr>
<tr><td align="left">9.2</td><td align="left"><details><summary> install </summary><pre><code> pip install mmcv-full==latest+torch1.5.0+cu92 -f https://openmmlab.oss-accelerate.aliyuncs.com/mmcv/dist/index.html
</code></pre> </details> </td> <td align="left"><details><summary> install </summary><pre><code>pip install mmcv-full==latest+torch1.4.0+cu92 -f https://openmmlab.oss-accelerate.aliyuncs.com/mmcv/dist/index.html
</code></pre> </details> </td> <td align="left"><details><summary> install </summary><pre><code>pip install mmcv-full==latest+torch1.3.0+cu92 -f https://openmmlab.oss-accelerate.aliyuncs.com/mmcv/dist/index.html
</code></pre> </details> </td></tr>
<tr><td align="left">cpu</td><td align="left"><details><summary> install </summary><pre><code> pip install mmcv-full==latest+torch1.5.0+cpu -f https://openmmlab.oss-accelerate.aliyuncs.com/mmcv/dist/index.html
</code></pre> </details> </td> <td align="left"><details><summary> install </summary><pre><code>pip install mmcv-full==latest+torch1.4.0+cpu -f https://openmmlab.oss-accelerate.aliyuncs.com/mmcv/dist/index.html
</code></pre> </details> </td> <td align="left"><details><summary> install </summary><pre><code>pip install mmcv-full==latest+torch1.3.0+cpu -f https://openmmlab.oss-accelerate.aliyuncs.com/mmcv/dist/index.html
</code></pre> </details> </td> </tr>
</tbody></table>
<table class="docutils">
<tbody>
<tr><th width="80"> CUDA </th><th valign="bottom" align="left" width="100">torch 1.6</th><th valign="bottom" align="left" width="100">torch 1.5</th><th valign="bottom" align="left" width="100">torch 1.4</th><th valign="bottom" align="left" width="100">torch 1.3</th></tr>
<tr>
<td align="left">10.2</td>
<td align="left"><details><summary> install </summary><pre><code>pip install mmcv-full==latest+torch1.6.0+cu102 -f https://download.openmmlab.com/mmcv/dist/index.html</code></pre> </details> </td>
<td align="left"><details><summary> install </summary><pre><code>pip install mmcv-full==latest+torch1.5.0+cu102 -f https://download.openmmlab.com/mmcv/dist/index.html</code></pre> </details> </td>
<td align="left"> </td>
<td align="left"> </td>
</tr>
<tr>
<td align="left">10.1</td>
<td align="left"><details><summary> install </summary><pre><code> pip install mmcv-full==latest+torch1.6.0+cu101 -f https://download.openmmlab.com/mmcv/dist/index.html</code></pre> </details> </td>
<td align="left"><details><summary> install </summary><pre><code> pip install mmcv-full==latest+torch1.5.0+cu101 -f https://download.openmmlab.com/mmcv/dist/index.html</code></pre> </details> </td>
<td align="left"><details><summary> install </summary><pre><code>pip install mmcv-full==latest+torch1.4.0+cu101 -f https://download.openmmlab.com/mmcv/dist/index.html</code></pre> </details> </td>
<td align="left"><details><summary> install </summary><pre><code>pip install mmcv-full==latest+torch1.3.0+cu101 -f https://download.openmmlab.com/mmcv/dist/index.html</code></pre> </details> </td>
</tr>
<tr>
<td align="left">9.2</td>
<td align="left"><details><summary> install </summary><pre><code> pip install mmcv-full==latest+torch1.6.0+cu92 -f https://download.openmmlab.com/mmcv/dist/index.html</code></pre> </details> </td>
<td align="left"><details><summary> install </summary><pre><code> pip install mmcv-full==latest+torch1.5.0+cu92 -f https://download.openmmlab.com/mmcv/dist/index.html</code></pre> </details> </td>
<td align="left"><details><summary> install </summary><pre><code>pip install mmcv-full==latest+torch1.4.0+cu92 -f https://download.openmmlab.com/mmcv/dist/index.html</code></pre> </details> </td>
<td align="left"><details><summary> install </summary><pre><code>pip install mmcv-full==latest+torch1.3.0+cu92 -f https://download.openmmlab.com/mmcv/dist/index.html</code></pre> </details> </td>
</tr>
<tr>
<td align="left">cpu</td>
<td align="left"><details><summary> install </summary><pre><code> pip install mmcv-full==latest+torch1.6.0+cpu -f https://download.openmmlab.com/mmcv/dist/index.html</code></pre> </details> </td>
<td align="left"><details><summary> install </summary><pre><code> pip install mmcv-full==latest+torch1.5.0+cpu -f https://download.openmmlab.com/mmcv/dist/index.html</code></pre> </details> </td>
<td align="left"><details><summary> install </summary><pre><code>pip install mmcv-full==latest+torch1.4.0+cpu -f https://download.openmmlab.com/mmcv/dist/index.html</code></pre> </details> </td>
<td align="left"><details><summary> install </summary><pre><code>pip install mmcv-full==latest+torch1.3.0+cpu -f https://download.openmmlab.com/mmcv/dist/index.html</code></pre> </details> </td>
</tr>
</tbody>
</table>

Another way is to compile locally by running

Expand Down Expand Up @@ -106,15 +122,32 @@ You can either
If you are on macOS, add the following environment variables before the installing command.

```bash
CC=lang CXX=clang++ CFLAGS='-stdlib=libc++'
CC=clang CXX=clang++ CFLAGS='-stdlib=libc++'
```

e.g.,

```bash
CC=lang CXX=clang++ CFLAGS='-stdlib=libc++' MMCV_WITH_OPS=1 pip install -e .
CC=clang CXX=clang++ CFLAGS='-stdlib=libc++' MMCV_WITH_OPS=1 pip install -e .
```

If you are on Windows10, set the following environment variable before the installing command.

```bash
set MMCV_WITH_OPS=1
```

e.g.,

```bash
set MMCV_WITH_OPS=1
pip install -e .
```

Note: If you would like to use `opencv-python-headless` instead of `opencv-python`,
e.g., in a minimum container environment or servers without GUI,
you can first install it before installing MMCV to skip the installation of `opencv-python`.

### TroubleShooting

If you meet issues when running or compiling mmcv, we list some common issues in [TROUBLESHOOTING.md](docs/trouble_shooting.md).
2 changes: 1 addition & 1 deletion docs/cnn.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## CNN

We provide some building bricks for CNNs, includeing layer building, module bundles and weight initialization.
We provide some building bricks for CNNs, including layer building, module bundles and weight initialization.

### Layer building

Expand Down
Loading

0 comments on commit c6cf6e2

Please sign in to comment.