From 8b65a2fe11485238dba892771b12d1e9b89e0895 Mon Sep 17 00:00:00 2001 From: Jiamin Date: Sun, 19 Jul 2020 22:18:13 +0800 Subject: [PATCH] feat: allow non_dist_train validation (#110) --- mmedit/apis/train.py | 5 ----- mmedit/core/evaluation/eval_hooks.py | 1 + 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/mmedit/apis/train.py b/mmedit/apis/train.py index cffb26c4ba..c955b7aa6f 100644 --- a/mmedit/apis/train.py +++ b/mmedit/apis/train.py @@ -182,11 +182,6 @@ def _non_dist_train(model, meta (dict | None): Meta dict to record some important information. Default: None. """ - if validate: - raise NotImplementedError('Built-in validation is not implemented ' - 'yet in not-distributed training. Use ' - 'distributed training or test.py and ' - '*eval.py scripts instead.') # prepare data loaders dataset = dataset if isinstance(dataset, (list, tuple)) else [dataset] data_loaders = [ diff --git a/mmedit/core/evaluation/eval_hooks.py b/mmedit/core/evaluation/eval_hooks.py index e8ff8c0acc..95dcb93f5b 100644 --- a/mmedit/core/evaluation/eval_hooks.py +++ b/mmedit/core/evaluation/eval_hooks.py @@ -36,6 +36,7 @@ def after_train_iter(self, runner): """ if not self.every_n_iters(runner, self.interval): return + runner.log_buffer.clear() from mmedit.apis import single_gpu_test results = single_gpu_test( runner.model,