Skip to content

Commit

Permalink
Merge pull request #1742 from chao1995/fix/del-optimizer
Browse files Browse the repository at this point in the history
PyTorchClassifier: delete optimizer before calling set_param()
  • Loading branch information
beat-buesser committed Jun 21, 2022
2 parents cb3605c + f1e44a2 commit e442608
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions art/estimators/classification/pytorch.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,7 @@ def clone_for_refitting(self) -> "PyTorchClassifier": # lgtm [py/inheritance/in
clone.reset()
params = self.get_params()
del params["model"]
del params["optimizer"]
clone.set_params(**params)
return clone

Expand Down

0 comments on commit e442608

Please sign in to comment.