未验证 提交 d1b3759e 编写于 作者: Q QI JUN 提交者: GitHub

Merge pull request #492 from QiJune/fix_bug_tc_infer

fix bug in infer.py of text classification
...@@ -28,7 +28,7 @@ def infer(topology, data_dir, model_path, word_dict_path, label_dict_path, ...@@ -28,7 +28,7 @@ def infer(topology, data_dir, model_path, word_dict_path, label_dict_path,
word_reverse_dict = dict((value, key) word_reverse_dict = dict((value, key)
for key, value in word_dict.iteritems()) for key, value in word_dict.iteritems())
label_reverse_dict = {0: "positive", 1: "negative"} label_reverse_dict = {0: "positive", 1: "negative"}
test_reader = paddle.dataset.imdb.test(word_dict) test_reader = paddle.dataset.imdb.test(word_dict)()
else: else:
assert os.path.exists( assert os.path.exists(
word_dict_path), "the word dictionary file does not exist" word_dict_path), "the word dictionary file does not exist"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册