From 32a463ebb82174e1a5453f7bbe18eca52728259e Mon Sep 17 00:00:00 2001 From: illcat <40688514+illcat@users.noreply.github.com> Date: Tue, 15 Sep 2020 17:16:44 +0800 Subject: [PATCH] fix issubclass (#545) --- propeller/paddle/train/trainer.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/propeller/paddle/train/trainer.py b/propeller/paddle/train/trainer.py index a9eab32..8388041 100644 --- a/propeller/paddle/train/trainer.py +++ b/propeller/paddle/train/trainer.py @@ -134,10 +134,10 @@ class Learner(object): if run_config.model_dir is None: raise ValueError('model_dir should specified in run_config') - if issubclass(model_class_or_model_fn, Model): - _model_fn = _build_model_fn(model_class_or_model_fn) - elif inspect.isfunction(model_class_or_model_fn): + if inspect.isfunction(model_class_or_model_fn): _model_fn = model_class_or_model_fn + elif issubclass(model_class_or_model_fn, Model): + _model_fn = _build_model_fn(model_class_or_model_fn) else: raise ValueError('unknown model %s' % model_class_or_model_fn) -- GitLab