Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
ain-soph committed Sep 15, 2023
1 parent d822ebf commit 2d1c5c7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion trojanzoo/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -957,7 +957,7 @@ def get_official_weights(self, weights: WeightsEnum | None = None,
OrderedDict[str, torch.Tensor]: The model weights OrderedDict.
"""
if weights is None:
weights = getattr(self.weights, self.name)
weights = getattr(self.weights[self.name], 'DEFAULT')
return weights.get_state_dict(progress=progress, check_hash=True,
map_location=map_location, **kwargs)

Expand Down
2 changes: 1 addition & 1 deletion trojanzoo/utils/module/param.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def items(self):
return self.__data.items()

def __getattr__(self, name: str) -> _VT:
if '__data' in name:
if name.startswith('__'):
return super().__getattr__(name)
return self.__data[name]

Expand Down

0 comments on commit 2d1c5c7

Please sign in to comment.