Skip to content

Commit 9393a04

Browse files
Added optional attributes (#264)
- train_epoch_length and eval_epoch_length have been set as optional according to engine definition
1 parent b9d5075 commit 9393a04

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/templates/template-common/config.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ train_batch_size: 32
44
eval_batch_size: 32
55
num_workers: 4
66
max_epochs: 20
7-
train_epoch_length: 1000
8-
eval_epoch_length: 1000
97
use_amp: false
108
debug: false
119

src/templates/template-common/utils.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ def setup_config(parser=None):
6464
with open(config_path, "r") as f:
6565
config = yaml.safe_load(f.read())
6666

67+
optional_attributes = ["train_epoch_length", "eval_epoch_length"]
68+
for attr in optional_attributes:
69+
config[attr] = config.get(attr, None)
70+
6771
for k, v in config.items():
6872
setattr(args, k, v)
6973

0 commit comments

Comments
 (0)