Skip to content

Commit

Permalink
fix: Fix deepcopy removing model signature wrapper (#108)
Browse files Browse the repository at this point in the history
* fix: Fix deepcopy removing model signature wrapper

* build: Upgrade version

* docs: Update changelog
  • Loading branch information
lorenzomammana authored Feb 14, 2024
1 parent 98ea3db commit c437a3d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
# Changelog
All notable changes to this project will be documented in this file.

### [2.0.2]

#### Fixed

- Fix deepcopy removing model signature wrapper from the model for classification

### [2.0.1]

#### Fixed
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "quadra"
version = "2.0.1"
version = "2.0.2"
description = "Deep Learning experiment orchestration library"
authors = [
"Federico Belotti <[email protected]>",
Expand Down
2 changes: 1 addition & 1 deletion quadra/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "2.0.1"
__version__ = "2.0.2"


def get_version():
Expand Down
3 changes: 2 additions & 1 deletion quadra/tasks/classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,8 @@ def generate_report(self) -> None:
self.datamodule.setup(stage="test")

# Deepcopy to remove the inference mode from gradients causing issues when loading checkpoints
self.module.model = deepcopy(self.module.model)
# TODO: Why deepcopy of module model removes ModelSignatureWrapper?
self.module.model.instance = deepcopy(self.module.model.instance)
if "16" in self.trainer.precision:
log.warning("Gradcam is currently not supported with half precision, it will be disabled")
self.module.gradcam = False
Expand Down

0 comments on commit c437a3d

Please sign in to comment.