diff --git a/pdseg/eval.py b/pdseg/eval.py index 54ff853c82d52fc0bbf25cde5a1561c60a22d405..b842431fb895c0985da1de5d5ef65073534a9835 100644 --- a/pdseg/eval.py +++ b/pdseg/eval.py @@ -111,6 +111,9 @@ def evaluate(cfg, ckpt_dir=None, use_gpu=False, use_mpio=False, **kwargs): ckpt_dir = cfg.TEST.TEST_MODEL if not ckpt_dir else ckpt_dir + if not os.path.exists(ckpt_dir): + raise ValueError('The TEST.TEST_MODEL {} is not found'.format(ckpt_dir)) + if ckpt_dir is not None: print('load test model:', ckpt_dir) fluid.io.load_params(exe, ckpt_dir, main_program=test_prog)