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

Add pytorch 1.6 to CI config (#3532)


* add pytorch 1.6 to CI config

* fix mmcv version

* fix corner head _topk

* fix typo

Co-authored-by: default avatarCao Yuhang <yhcao6@gmail.com>
parent 7ab8f440
No related branches found
No related tags found
No related merge requests found
......@@ -24,16 +24,32 @@ jobs:
build_cpu:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7]
torch: [1.3.0, 1.4.0, 1.5.0, 1.6.0]
include:
- torch: 1.3.0
torchvision: 0.4.2
- torch: 1.4.0
torchvision: 0.5.0
- torch: 1.5.0
torchvision: 0.6.1
- torch: 1.6.0
torchvision: 0.7.0
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: 3.7
python-version: ${{ matrix.python-version }}
- name: Install Pillow
run: pip install Pillow==6.2.2
if: ${{matrix.torchvision == '0.4.2'}}
- 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
run: pip install torch==${{matrix.torch}}+cpu torchvision==${{matrix.torchvision}}+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
run: pip install mmcv-full==latest+torch${{matrix.torch}}+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
......@@ -53,17 +69,26 @@ jobs:
UBUNTU_VERSION: ubuntu1804
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
mmcv: "latest+torch1.3.0+cu101"
cuda_arch: "6.0"
- torch: 1.5.1+cu101
torchvision: 0.6.1+cu101
mmcv: "latest+torch1.5.0+cu101"
cuda_arch: "7.0"
- torch: 1.6.0+cu101
torchvision: 0.7.0+cu101
mmcv: "latest+torch1.6.0+cu101"
- torch: 1.6.0+cu101
torchvision: 0.7.0+cu101
mmcv: "latest+torch1.6.0+cu101"
python-version: 3.6
- torch: 1.6.0+cu101
torchvision: 0.7.0+cu101
mmcv: "latest+torch1.6.0+cu101"
python-version: 3.8
steps:
- uses: actions/checkout@v2
......@@ -97,7 +122,7 @@ jobs:
run: |
rm -rf .eggs
python setup.py check -m -s
TORCH_CUDA_ARCH_LIST=${{matrix.cuda_arch}} pip install .
TORCH_CUDA_ARCH_LIST=7.0 pip install .
- name: Run unittests and generate coverage report
run: |
coverage run --branch --source mmdet -m pytest tests/
......
......@@ -827,9 +827,9 @@ class CornerHead(BaseDenseHead):
"""
batch, _, height, width = scores.size()
topk_scores, topk_inds = torch.topk(scores.view(batch, -1), k)
topk_clses = (topk_inds / (height * width)).int()
topk_clses = topk_inds // (height * width)
topk_inds = topk_inds % (height * width)
topk_ys = (topk_inds / width).int().float()
topk_ys = topk_inds // width
topk_xs = (topk_inds % width).int().float()
return topk_scores, topk_inds, topk_clses, topk_ys, topk_xs
......
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