Skip to content

Commit

Permalink
Fix VisionTransformeroutput check
Browse files Browse the repository at this point in the history
  • Loading branch information
harimkang committed Mar 20, 2023
1 parent 85f033a commit 3b0c148
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion otx/mpa/cls/stage.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def configure_in_channel(cfg):
if isinstance(output, (tuple, list)):
output = output[-1]

if layer.__class__.__name__ in TRANSFORMER_BACKBONES:
if layer.__class__.__name__ in TRANSFORMER_BACKBONES and isinstance(output, (tuple, list)):
# mmcls.VisionTransformer outputs Tuple[List[...]] and the last index of List is the final logit.
_, output = output

Expand Down

0 comments on commit 3b0c148

Please sign in to comment.