Skip to content

Commit a969237

Browse files
authored
Minor update to UNETR (#203)
1 parent d044276 commit a969237

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

torch_em/model/unetr.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,10 @@ def __init__(
104104
else:
105105
embed_dim = self.encoder.patch_embed.proj.out_channels
106106

107-
in_chans = self.encoder.patch_embed.proj.in_channels
107+
try:
108+
in_chans = self.encoder.patch_embed.proj.in_channels
109+
except AttributeError: # for getting the input channels while using vit_t from MobileSam
110+
in_chans = self.encoder.patch_embed.seq[0].c.in_channels
108111

109112
# parameters for the decoder network
110113
depth = 3

0 commit comments

Comments
 (0)