diff --git a/ppdet/core/workspace.py b/ppdet/core/workspace.py index 03c53df58a9d00feb1578b46dfb4eeaf345a519e..d7074a1f43418c13abdedebf4ea4f3bf76104de7 100644 --- a/ppdet/core/workspace.py +++ b/ppdet/core/workspace.py @@ -139,7 +139,7 @@ def merge_config(config, another_cfg=None): # batch size config to global, models can get batch size config # from global config when building model. # batch size in evaluation or inference can also be added here - if 'TrainReader' in dct: + if 'TrainReader' in dct and 'batch_size' in dct['TrainReader']: dct['train_batch_size'] = dct['TrainReader']['batch_size'] return dct