Skip to content

Commit

Permalink
[fix] prevent samples to be changed out of logger function
Browse files Browse the repository at this point in the history
  • Loading branch information
hglee98 committed Dec 18, 2024
1 parent 1ccc99a commit b42a73c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/netspresso_trainer/loggers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#
# ----------------------------------------------------------------------------

from copy import deepcopy
from pathlib import Path
from typing import Dict, List, Literal, Optional, Tuple, Union

Expand Down Expand Up @@ -169,7 +170,7 @@ def log(
if metrics is not None:
metrics = self._convert_scalar_as_readable(metrics)
if samples is not None:
samples = self._convert_images_as_readable(samples)
samples = self._convert_images_as_readable(deepcopy(samples))

for logger in self.loggers:
logger(
Expand Down

0 comments on commit b42a73c

Please sign in to comment.