Skip to content

Commit

Permalink
Update cutie.py
Browse files Browse the repository at this point in the history
  • Loading branch information
hkchengrex authored Aug 23, 2024
1 parent 315c1ac commit b002b5b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cutie/model/cutie.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,8 @@ def load_weights(self, src_dict, init_as_zero_if_needed=False) -> None:
This is not supposed to happen in standard training except when users are trying to
finetune a trained model with single object datasets.
"""
if src_dict['mask_encoder.conv1.weight'].shape[1] == 5:
k = 'mask_encoder.conv1.weight'
if src_dict[k].shape[1] == 5:
log.warning(f'Converting {k} from multiple objects to single object.'
'This is not supposed to happen in standard training.')
src_dict[k] = src_dict[k][:, :-1]
Expand Down

0 comments on commit b002b5b

Please sign in to comment.