Merge pull request #820 from cuicheng01/develop_reg

fix eval_interval bugs
pull/822/head
Wei Shengyu 2021-06-10 16:56:50 +08:00 committed by GitHub
commit 4905424f31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -35,8 +35,8 @@ from ppcls.data.preprocess import transform
def build_dataloader(config, mode, device, seed=None):
assert mode in ['Train', 'Eval', 'Test', 'Gallery', 'Query'
], "Mode should be Train, Eval, Test, Gallery or Query"
assert mode in ['Train', 'Eval', 'Test',
], "Mode should be Train, Eval, Test"
# build dataset
config_dataset = config[mode]['dataset']
config_dataset = copy.deepcopy(config_dataset)

View File

@ -223,7 +223,7 @@ class Trainer(object):
# eval model and save model if possible
if self.config["Global"][
"eval_during_train"] and epoch_id % self.config["Global"][
"eval_during_train"] == 0:
"eval_interval"] == 0:
acc = self.eval(epoch_id)
if acc > best_metric["metric"]:
best_metric["metric"] = acc