未验证 提交 6e9578ff 编写于 作者: C Christian Clauss 提交者: GitHub

Undefined name: 'v' --> 'inf_sepc'

The current code would raise NameError instead of the expected ValueError.

flake8 testing of https://github.com/PaddlePaddle/ERNIE on Python 3.8.0

$ __flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics__
```
./propeller/paddle/train/exporter.py:86:73: F821 undefined name 'v'
                    raise ValueError('unkonw inference spec type: %s' % v)
                                                                        ^
```
上级 2713053e
...@@ -83,7 +83,7 @@ class BestInferenceModelExporter(Exporter): ...@@ -83,7 +83,7 @@ class BestInferenceModelExporter(Exporter):
inf_sepc_dict = {'inference': inf_sepc_dict} inf_sepc_dict = {'inference': inf_sepc_dict}
for inf_sepc_name, inf_sepc in six.iteritems(inf_sepc_dict): for inf_sepc_name, inf_sepc in six.iteritems(inf_sepc_dict):
if not isinstance(inf_sepc, InferenceSpec): if not isinstance(inf_sepc, InferenceSpec):
raise ValueError('unkonw inference spec type: %s' % v) raise ValueError('unknown inference spec type: %s' % inf_sepc)
save_dir = os.path.join(self._export_dir, inf_sepc_name) save_dir = os.path.join(self._export_dir, inf_sepc_name)
log.debug('[Best Exporter]: save inference model: "%s" to %s' % log.debug('[Best Exporter]: save inference model: "%s" to %s' %
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册