diff --git a/ppcls/data/postprocess/topk.py b/ppcls/data/postprocess/topk.py index cd45734ef3997a53b228cac73eb62a53ee2ec4ce..50cc40d4948215ddf7bedcd12ab03084e165d313 100644 --- a/ppcls/data/postprocess/topk.py +++ b/ppcls/data/postprocess/topk.py @@ -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