Skip to content

Commit 5305a45

Browse files
authored
Merge pull request open-mmlab#323 from hellock/master
Minor fix for dcn check in the backbone
2 parents 3b43f49 + 716457e commit 5305a45

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

mmdet/models/backbones/resnet.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,7 @@ def __init__(self,
331331
assert num_stages >= 1 and num_stages <= 4
332332
self.strides = strides
333333
self.dilations = dilations
334-
assert len(strides) == len(dilations) == len(
335-
stage_with_dcn) == num_stages
334+
assert len(strides) == len(dilations) == num_stages
336335
self.out_indices = out_indices
337336
assert max(out_indices) < num_stages
338337
self.style = style
@@ -342,6 +341,8 @@ def __init__(self,
342341
self.norm_eval = norm_eval
343342
self.dcn = dcn
344343
self.stage_with_dcn = stage_with_dcn
344+
if dcn is not None:
345+
assert len(stage_with_dcn) == num_stages
345346
self.zero_init_residual = zero_init_residual
346347
self.block, stage_blocks = self.arch_settings[depth]
347348
self.stage_blocks = stage_blocks[:num_stages]

0 commit comments

Comments
 (0)