From 2f1f562dc4b4f9056e107f7669a32b8103ec83de Mon Sep 17 00:00:00 2001 From: lijian Date: Fri, 14 Nov 2025 18:22:42 +0800 Subject: [PATCH] onnx demo minor fix --- .../04.\347\246\273\347\272\277\346\216\250\347\220\206.md" | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git "a/ACL_PyTorch/docs/ONNX/04.\347\246\273\347\272\277\346\216\250\347\220\206.md" "b/ACL_PyTorch/docs/ONNX/04.\347\246\273\347\272\277\346\216\250\347\220\206.md" index 20f5e60900..c1b4f81291 100644 --- "a/ACL_PyTorch/docs/ONNX/04.\347\246\273\347\272\277\346\216\250\347\220\206.md" +++ "b/ACL_PyTorch/docs/ONNX/04.\347\246\273\347\272\277\346\216\250\347\220\206.md" @@ -152,7 +152,7 @@ print(inferencer.e2e_inference("./ILSVRC2012_val_00006083.jpeg")) 2. 使用数据集测试模型精度 ```python - def evaluate(inferencer, image_dir, label_file): + def evaluate(inferencer, img_dir, label_file): groundtruth = {} with open(label_file, 'r') as f: for line in f: @@ -161,7 +161,7 @@ print(inferencer.e2e_inference("./ILSVRC2012_val_00006083.jpeg")) num_total, num_right = 0, 0 for i, image_name in tqdm.tqdm(enumerate(os.listdir(img_dir))): - label = gt_dict[image_name] + label = groundtruth[image_name] image_path = osp.join(img_dir, image_name) pred = inferencer.e2e_inference(image_path)['class_id'] num_total += 1 -- Gitee