Skip to content

Commit

Permalink
fix mypy error
Browse files Browse the repository at this point in the history
Signed-off-by: vgrau98 <[email protected]>
  • Loading branch information
vgrau98 committed Oct 17, 2023
1 parent 1a29bb2 commit 8198203
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions monai/networks/nets/resnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,11 @@ def _resnet(
# Also check bias downsample and shortcut.
if kwargs.get("spatial_dims", 3) == 3:
if kwargs.get("n_input_channels", 3) == 1 and kwargs.get("feed_forward", True) is False:
resnet_depth = int(re.search(r"resnet(\d+)", arch).group(1))
# get shortcut_type and bias_downsample.
search_res = re.search(r"resnet(\d+)", arch)
if search_res:
resnet_depth = int(search_res.group(1))
else:
raise ValueError("arch argument should be as 'resnet_\{resnet_depth\}")

# Check model bias_downsample and shortcut_type
bias_downsample, shortcut_type = get_medicalnet_pretrained_resnet_args(resnet_depth)
Expand Down

0 comments on commit 8198203

Please sign in to comment.