Skip to content

Commit

Permalink
Update writer init in callback manager
Browse files Browse the repository at this point in the history
  • Loading branch information
mlahariya committed Nov 20, 2024
1 parent 97e8744 commit 56b9706
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions qadence/ml_tools/callbacks/callbackmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ def __init__(self, config: TrainConfig):
config (TrainConfig): The training configuration object.
"""
self.config = config
tracking_tool = self.config.tracking_tool
self.writer = get_writer(tracking_tool)
self.callbacks: list[Callback] = []

@classmethod
Expand Down Expand Up @@ -199,10 +201,7 @@ def start_training(self, trainer: Any) -> None:
logger.debug(f"Loaded model and optimizer from {self.config.log_folder}")

# Setup writer
tracking_tool = self.config.tracking_tool
writer = get_writer(tracking_tool)
writer.open(self.config, iteration=trainer.global_step)
self.writer = writer
self.writer.open(self.config, iteration=trainer.global_step)

def end_training(self, trainer: Any) -> None:
"""
Expand Down

0 comments on commit 56b9706

Please sign in to comment.