Skip to content

Commit

Permalink
[Fix] Fix CI bug due to mmcv index (#495)
Browse files Browse the repository at this point in the history
* resolve comments

* update changelog

* remove -q to check

* update checking

* Update build.yml

* update CI, GPU use torch 1.5.0

* switch torchvision to 0.6.0

Co-authored-by: lizz <innerlee@users.noreply.github.com>
  • Loading branch information
kennymckormick and innerlee committed Jan 10, 2021
1 parent 023777c commit 5ce7035
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 22 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ jobs:
strategy:
matrix:
python-version: [3.7]
torch: [1.3.0, 1.5.1, 1.6.0, 1.7.0]
torch: [1.3.0, 1.5.0, 1.6.0, 1.7.0]
include:
- torch: 1.3.0
torchvision: 0.4.1
- torch: 1.5.1
torchvision: 0.6.1
- torch: 1.5.0
torchvision: 0.6.0
- torch: 1.6.0
torchvision: 0.7.0
- torch: 1.7.0
Expand Down Expand Up @@ -60,7 +60,7 @@ jobs:
- name: Install MMCV
run: pip install mmcv-full==1.2.4 -f https://download.openmmlab.com/mmcv/dist/cpu/torch${{matrix.torch}}/index.html
- name: Install MMDet
run: pip install -q git+https://github.com/open-mmlab/mmdetection/
run: pip install git+https://github.com/open-mmlab/mmdetection/
- name: Install unittest dependencies
run: pip install -r requirements/tests.txt -r requirements/optional.txt
- name: Build and install
Expand All @@ -80,14 +80,14 @@ jobs:
strategy:
matrix:
python-version: [3.7]
torch: [1.3.0, 1.5.1+cu101, 1.6.0+cu101, 1.7.0+cu101]
torch: [1.3.0, 1.5.0+cu101, 1.6.0+cu101, 1.7.0+cu101]
include:
- torch: 1.3.0
torchvision: 0.4.1
mmcv: "cu101/torch1.3.0"
- torch: 1.5.1+cu101
torchvision: 0.6.1+cu101
mmcv: "cu101/torch1.5.1"
- torch: 1.5.0+cu101
torchvision: 0.6.0+cu101
mmcv: "cu101/torch1.5.0"
- torch: 1.6.0+cu101
torchvision: 0.7.0+cu101
mmcv: "cu101/torch1.6.0"
Expand Down
5 changes: 3 additions & 2 deletions mmaction/core/bbox/assigners/max_iou_assigner_ava.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
import torch

try:
import mmdet # noqa
from mmdet.core.bbox import AssignResult, MaxIoUAssigner
from mmdet.core.bbox.builder import BBOX_ASSIGNERS
mmdet_imported = True
except (ImportError, ModuleNotFoundError):
warnings.warn('Please install mmdet to use AssignResult, MaxIoUAssigner '
'and BBOX_ASSIGNERS')
mmdet_imported = False

if 'mmdet' in dir():
if mmdet_imported:

@BBOX_ASSIGNERS.register_module()
class MaxIoUAssignerAVA(MaxIoUAssigner):
Expand Down
5 changes: 3 additions & 2 deletions mmaction/models/backbones/resnet3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
from ..registry import BACKBONES

try:
import mmdet # noqa
from mmdet.models.builder import SHARED_HEADS as MMDET_SHARED_HEADS
mmdet_imported = True
except (ImportError, ModuleNotFoundError):
warnings.warn('Please install mmdet to use MMDET_SHARED_HEADS')
mmdet_imported = False


class BasicBlock3d(nn.Module):
Expand Down Expand Up @@ -999,5 +1000,5 @@ def train(self, mode=True):
m.eval()


if 'mmdet' in dir():
if mmdet_imported:
MMDET_SHARED_HEADS.register_module()(ResNet3dLayer)
5 changes: 3 additions & 2 deletions mmaction/models/backbones/resnet3d_slowfast.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@
from .resnet3d import ResNet3d

try:
import mmdet # noqa
from mmdet.models import BACKBONES as MMDET_BACKBONES
mmdet_imported = True
except (ImportError, ModuleNotFoundError):
warnings.warn('Please install mmdet to use MMDET_BACKBONES')
mmdet_imported = False


class ResNet3dPathway(ResNet3d):
Expand Down Expand Up @@ -509,5 +510,5 @@ def forward(self, x):
return out


if 'mmdet' in dir():
if mmdet_imported:
MMDET_BACKBONES.register_module()(ResNet3dSlowFast)
5 changes: 3 additions & 2 deletions mmaction/models/backbones/resnet3d_slowonly.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
from .resnet3d_slowfast import ResNet3dPathway

try:
import mmdet # noqa
from mmdet.models.builder import BACKBONES as MMDET_BACKBONES
mmdet_imported = True
except (ImportError, ModuleNotFoundError):
warnings.warn('Please install mmdet to use MMDET_BACKBONES')
mmdet_imported = False


@BACKBONES.register_module()
Expand Down Expand Up @@ -50,5 +51,5 @@ def __init__(self,
assert not self.lateral


if 'mmdet' in dir():
if mmdet_imported:
MMDET_BACKBONES.register_module()(ResNet3dSlowOnly)
5 changes: 3 additions & 2 deletions mmaction/models/heads/bbox_head.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
from mmaction.core.bbox import bbox_target

try:
import mmdet # noqa
from mmdet.models.builder import HEADS as MMDET_HEADS
mmdet_imported = True
except (ImportError, ModuleNotFoundError):
warnings.warn('Please install mmdet to use MMDET_HEADS')
mmdet_imported = False


class BBoxHeadAVA(nn.Module):
Expand Down Expand Up @@ -217,5 +218,5 @@ def _bbox_crop_undo(bboxes, crop_quadruple):
return bboxes, scores


if 'mmdet' in dir():
if mmdet_imported:
MMDET_HEADS.register_module()(BBoxHeadAVA)
5 changes: 3 additions & 2 deletions mmaction/models/heads/roi_head.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@
from mmaction.core.bbox import bbox2result

try:
import mmdet # noqa
from mmdet.core.bbox import bbox2roi
from mmdet.models import HEADS as MMDET_HEADS
from mmdet.models.roi_heads import StandardRoIHead
mmdet_imported = True
except (ImportError, ModuleNotFoundError):
warnings.warn('Please install mmdet to use bbox2roi, MMDET_HEADS '
'and StandardRoIHead')
mmdet_imported = False

if 'mmdet' in dir():
if mmdet_imported:

@MMDET_HEADS.register_module()
class AVARoIHead(StandardRoIHead):
Expand Down
5 changes: 3 additions & 2 deletions mmaction/models/roi_extractors/single_straight3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
warnings.warn('Please install mmcv-full to use RoIAlign and RoIPool')

try:
import mmdet # noqa
from mmdet.models import ROI_EXTRACTORS
mmdet_imported = True
except (ImportError, ModuleNotFoundError):
warnings.warn('Please install mmdet to use ROI_EXTRACTORS')
mmdet_imported = False


class SingleRoIExtractor3D(nn.Module):
Expand Down Expand Up @@ -101,5 +102,5 @@ def forward(self, feat, rois):
return torch.stack(roi_feats, dim=2)


if 'mmdet' in dir():
if mmdet_imported:
ROI_EXTRACTORS.register_module()(SingleRoIExtractor3D)

0 comments on commit 5ce7035

Please sign in to comment.