提交 7d8d7910 编写于 作者: L LiuChiaChi

fix Model bugs, because inputs can be list or dict when it is provided.

上级 c941c361
...@@ -858,7 +858,10 @@ class Model(object): ...@@ -858,7 +858,10 @@ class Model(object):
raise TypeError( raise TypeError(
"'inputs' must be list or dict, and couldn't be None.") "'inputs' must be list or dict, and couldn't be None.")
elif inputs: elif inputs:
self._shapes = [list(input.shape) for input in inputs] if isinstance(inputs, list):
self._shapes = [list(input.shape) for input in inputs]
elif isinstance(inputs, dict):
self._shapes = [list(inputs[name]) for name in inputs]
self._inputs = self._verify_spec(inputs, is_input=True) self._inputs = self._verify_spec(inputs, is_input=True)
self._labels = self._verify_spec(labels) self._labels = self._verify_spec(labels)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册