未验证 提交 32a463eb 编写于 作者: I illcat 提交者: GitHub

fix issubclass (#545)

上级 4eb65ce4
...@@ -134,10 +134,10 @@ class Learner(object): ...@@ -134,10 +134,10 @@ class Learner(object):
if run_config.model_dir is None: if run_config.model_dir is None:
raise ValueError('model_dir should specified in run_config') raise ValueError('model_dir should specified in run_config')
if issubclass(model_class_or_model_fn, Model): if inspect.isfunction(model_class_or_model_fn):
_model_fn = _build_model_fn(model_class_or_model_fn)
elif inspect.isfunction(model_class_or_model_fn):
_model_fn = 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: else:
raise ValueError('unknown model %s' % model_class_or_model_fn) raise ValueError('unknown model %s' % model_class_or_model_fn)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册