瀏覽代碼

fix restful bug

will-jl944 4 年之前
父節點
當前提交
230de06229
共有 1 個文件被更改,包括 3 次插入8 次删除
  1. 3 8
      paddlex_restful/restful/project/evaluate/classification.py

+ 3 - 8
paddlex_restful/restful/project/evaluate/classification.py

@@ -1,4 +1,4 @@
-# copyright (c) 2021 PaddlePaddle Authors. All Rights Reserve.
+# copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -17,18 +17,13 @@ import yaml
 import os.path as osp
 import numpy as np
 from sklearn.metrics import confusion_matrix, roc_curve, auc
-from paddlex_restful.restful.dataset.utils import get_encoding
 
 
 class Evaluator(object):
     def __init__(self, model_path, topk=5):
-        model_yml = osp.join(model_path, "model.yml")
-        with open(model_yml, encoding=get_encoding(model_yml)) as f:
+        with open(osp.join(model_path, "model.yml")) as f:
             model_info = yaml.load(f.read(), Loader=yaml.Loader)
-        eval_details_file = osp.join(model_path, 'eval_details.json')
-        with open(
-                eval_details_file, 'r',
-                encoding=get_encoding(eval_details_file)) as f:
+        with open(osp.join(model_path, 'eval_details.json'), 'r') as f:
             eval_details = json.load(f)
         self.topk = topk