Skip to content

Commit

Permalink
[Fix] fix sam bug (open-mmlab#1633)
Browse files Browse the repository at this point in the history
  • Loading branch information
zzc98 authored Jun 15, 2023
1 parent 3eaf719 commit 53648ba
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mmpretrain/models/backbones/vit_sam.py
Original file line number Diff line number Diff line change
Expand Up @@ -593,11 +593,11 @@ def forward(self, x: torch.Tensor) -> Tuple[torch.Tensor]:

if i in self.out_indices:
# (B, H, W, C) -> (B, C, H, W)
x = x.permute(0, 3, 1, 2)
x_reshape = x.permute(0, 3, 1, 2)

if self.out_channels > 0:
x = self.channel_reduction(x)
outs.append(self._format_output(x))
x_reshape = self.channel_reduction(x_reshape)
outs.append(self._format_output(x_reshape))

return tuple(outs)

Expand Down

0 comments on commit 53648ba

Please sign in to comment.