Skip to content

Commit 70346d9

Browse files
committedMar 14, 2023
filter the args
1 parent e5dfddc commit 70346d9

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed
 

‎train.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -734,9 +734,8 @@ def main():
734734
if should_log_to_tensorboard(args):
735735
if has_tensorboard:
736736
tensorboard_writer = SummaryWriter(args.log_tensorboard)
737-
#write Hyperparameters to tensorboard
738-
#get all args keys that are one of int, float, str, bool, or torch.Tensor
739-
hparams = {k: v for k, v in vars(args).items() if type(v) in [int, float, str, bool, torch.Tensor]}
737+
#write Hyperparameters to tensorboard, remove Nones
738+
hparams = {k: v for k, v in vars(args).items() if v is not None}
740739
tensorboard_writer.add_hparams(hparams, {})
741740

742741
else:

0 commit comments

Comments
 (0)
Failed to load comments.