fix: add more fallbacks for mmpkg (#510)

pull/514/head
Mikubill 2023-03-06 13:18:28 +00:00
parent d41c470ebc
commit 6a425582e9
3 changed files with 15 additions and 4 deletions

View File

@ -4,7 +4,10 @@ from ..builder import HEADS
from .fcn_head import FCNHead
try:
from annotator.mmpkg.mmcv.ops import CrissCrossAttention
try:
from mmcv.ops import CrissCrossAttention
except ImportError:
from annotator.mmpkg.mmcv.ops import CrissCrossAttention
except ModuleNotFoundError:
CrissCrossAttention = None

View File

@ -2,8 +2,13 @@
import torch
import torch.nn as nn
from annotator.mmpkg.mmcv.cnn import ConvModule, normal_init
from annotator.mmpkg.mmcv.ops import point_sample
try:
from mmcv.cnn import ConvModule, normal_init
from mmcv.ops import point_sample
except ImportError:
from annotator.mmpkg.mmcv.cnn import ConvModule, normal_init
from annotator.mmpkg.mmcv.ops import point_sample
from annotator.mmpkg.mmseg.models.builder import HEADS
from annotator.mmpkg.mmseg.ops import resize

View File

@ -8,7 +8,10 @@ from ..builder import HEADS
from .decode_head import BaseDecodeHead
try:
from annotator.mmpkg.mmcv.ops import PSAMask
try:
from mmcv.ops import PSAMask
except ImportError:
from annotator.mmpkg.mmcv.ops import PSAMask
except ModuleNotFoundError:
PSAMask = None