mirror of
https://github.com/open-mmlab/mmsegmentation.git
synced 2025-06-03 22:03:48 +08:00
[Improvement] Add more CI (#460)
* add more CI * fix missing * remove python-version * fixed acc
This commit is contained in:
parent
99ab9bd2d9
commit
d283ca6fea
23
.github/workflows/build.yml
vendored
23
.github/workflows/build.yml
vendored
@ -1,6 +1,6 @@
|
||||
name: build
|
||||
|
||||
on: [push, pull_request]
|
||||
on: [ push, pull_request ]
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
@ -29,25 +29,26 @@ jobs:
|
||||
UBUNTU_VERSION: ubuntu1804
|
||||
FORCE_CUDA: 1
|
||||
MMCV_CUDA_ARGS: -gencode=arch=compute_61,code=sm_61
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-18.04
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: [3.6, 3.7]
|
||||
torch: [1.3.0+cpu, 1.5.0+cpu]
|
||||
python-version: [ 3.6, 3.7 ]
|
||||
torch: [ 1.3.0+cpu, 1.5.0+cpu, 1.5.0+cu101, 1.6.0+cu101, 1.7.0+cu101, 1.8.0+cu101 ]
|
||||
include:
|
||||
- torch: 1.3.0+cpu
|
||||
torchvision: 0.4.1+cpu
|
||||
- torch: 1.5.0+cpu
|
||||
torchvision: 0.6.0+cpu
|
||||
- torch: 1.5.0+cpu
|
||||
torchvision: 0.6.0+cpu
|
||||
python-version: 3.8
|
||||
- torch: 1.5.0+cu101
|
||||
torchvision: 0.6.0+cu101
|
||||
python-version: 3.7
|
||||
- torch: 1.6.0+cu101
|
||||
torchvision: 0.7.0+cu101
|
||||
python-version: 3.7
|
||||
- torch: 1.7.0+cu101
|
||||
torchvision: 0.8.1+cu101
|
||||
- torch: 1.8.0+cu101
|
||||
torchvision: 0.9.0+cu101
|
||||
- torch: 1.8.0+cu101
|
||||
torchvision: 0.9.0+cu101
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
@ -56,7 +57,7 @@ jobs:
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Install CUDA
|
||||
if: ${{matrix.torch == '1.5.0+cu101'}}
|
||||
if: ${{matrix.torch == '1.5.0+cu101' || matrix.torch == '1.6.0+cu101' || matrix.torch == '1.7.0+cu101' || matrix.torch == '1.8.0+cu101'}}
|
||||
run: |
|
||||
export INSTALLER=cuda-repo-${UBUNTU_VERSION}_${CUDA}_amd64.deb
|
||||
wget http://developer.download.nvidia.com/compute/cuda/repos/${UBUNTU_VERSION}/x86_64/${INSTALLER}
|
||||
@ -88,7 +89,7 @@ jobs:
|
||||
coverage report -m
|
||||
# Only upload coverage report for python3.7 && pytorch1.5
|
||||
- name: Upload coverage to Codecov
|
||||
if: ${{matrix.torch == '1.5.0+cu101' && matrix.python-version == '3.7'}}
|
||||
if: ${{matrix.torch == '1.8.0+cu101' && matrix.python-version == '3.7'}}
|
||||
uses: codecov/codecov-action@v1.0.10
|
||||
with:
|
||||
file: ./coverage.xml
|
||||
|
File diff suppressed because one or more lines are too long
@ -44,7 +44,7 @@ def accuracy(pred, target, topk=1, thresh=None):
|
||||
correct = correct & (pred_value > thresh).t()
|
||||
res = []
|
||||
for k in topk:
|
||||
correct_k = correct[:k].view(-1).float().sum(0, keepdim=True)
|
||||
correct_k = correct[:k].reshape(-1).float().sum(0, keepdim=True)
|
||||
res.append(correct_k.mul_(100.0 / target.numel()))
|
||||
return res[0] if return_single else res
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user