Added code saving by default
@@ -42,7 +42,8 @@ class WandBLogger(StrategyLogger):
run_name: str = "Test", log_artifacts: bool = False,
path: str = "Checkpoints", checkpoint: str = "Model.pth",
uri: str = None, sync_tfboard: bool = False,
- config: object = None, params: dict = None):
+ save_code: bool = True, config: object = None,
+ params: dict = None):
"""
Creates an instance of the `WandBLogger`.
:param project_name: Name of the W&B project.
@@ -52,6 +53,7 @@ class WandBLogger(StrategyLogger):
:param checkpoint: Name of the model checkpoint file.
:param uri: Reference to external URI.
:param sync_tfboard: Syncs TensorBoard to the W&B dashboard UI.
+ :param save_code: Saves the main training script to W&B.
:param config: Syncs hyper-parameters and config values used to W&B.
:param params: All arguments for wandb.init() function call.
Visit https://docs.wandb.ai/ref/python/init to learn about all
@@ -66,6 +68,7 @@ class WandBLogger(StrategyLogger):
self.checkpoint = checkpoint
self.uri = uri
self.sync_tfboard = sync_tfboard
+ self.save_code = save_code
self.config = config
self.params = params
self.args_parse()
@@ -82,7 +85,7 @@ class WandBLogger(StrategyLogger):
def args_parse(self):
self.init_kwargs = {"project": self.project_name, "name": self.run_name,
"sync_tensorboard": self.sync_tfboard,
- "config": self.config}
+ "save_code": self.save_code, "config": self.config}
if self.params:
self.init_kwargs.update(self.params)
