未验证 提交 d7a7d3e5 编写于 作者: Z zhangyubo0722 提交者: GitHub

fix topk bug (#2945)

上级 74a33b7f
......@@ -42,9 +42,9 @@ class Topk(object):
except Exception as e:
with open(class_id_map_file, "r", encoding='gbk') as fin:
lines = fin.readlines()
for line in lines:
partition = line.split("\n")[0].partition(self.delimiter)
class_id_map[int(partition[0])] = str(partition[-1])
for line in lines:
partition = line.split("\n")[0].partition(self.delimiter)
class_id_map[int(partition[0])] = str(partition[-1])
except Exception as ex:
print(ex)
class_id_map = None
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册