PaddlePaddle / PaddleClas

A treasure chest for visual classification and recognition powered by PaddlePaddle
Apache License 2.0
5.46k stars 1.17k forks source link

quick_start_classification_new_user.md 模型预测报错 'Topk' object has no attribute 'delimiter' #2111

Closed bk1ing closed 2 years ago

bk1ing commented 2 years ago
  1. PaddleClas版本以及PaddlePaddle版本: paddleclas 2.4.0、paddlepaddle 2.3.0

  2. 涉及的其他产品使用的版本号:

  3. 训练环境信息: a. 具体操作系统,Windows 10 IoT 企业版 LTSC x64,版本号 21H2,操作系统内部版本号 19044.1766 b. Python版本号,Python 3.9.10、pip 22.0.3 c. CUDA/cuDNN版本, 无,使用CPU训练,

  4. 完整的代码(相比于repo中代码,有改动的地方)、详细的错误信息及相关log 按照 https://gitee.com/paddlepaddle/PaddleClas/blob/release/2.4/docs/zh_CN/quick_start/quick_start_classification_new_user.md 进行训练、没有报错、也生成了 best_model 但是 进行 模型预测 时,却显示 [2022/06/27 21:42:08] ppcls INFO: train with paddle 2.3.0 and device Place(cpu) 'Topk' object has no attribute 'delimiter' [{'class_ids': [70, 20, 34, 9, 29], 'scores': [0.08034, 0.03363, 0.0325, 0.02877, 0.02854], 'file_name': 'deploy/dataset/flowers102/jpg/image_00001.jpg', 'label_names': []}]

weisy11 commented 2 years ago

感谢指出问题,我们排查一下

jkluo commented 2 years ago

我使用develop的分支,进行训练和预测,是跑通了的。

TingquanGao commented 2 years ago

@bk1ing 你好,可以尝试从GitHub上clone的最新代码再试下。

qlons commented 1 year ago

我也出现了这个问题,推测时label_names为空 我使用2.3出现同样问题,切换到paddleclas 2.2有label_names正常,还是用新的吧🤣

[2022/12/13 08:25:53] ppcls INFO: train with paddle 2.4.0 and device Place(gpu:0) W1213 08:25:53.891273 5361 gpu_resources.cc:61] Please NOTE: device: 0, GPU Compute Capability: 7.0, Driver API Version: 11.2, Runtime API Version: 11.2 W1213 08:25:53.895237 5361 gpu_resources.cc:91] device: 0, cuDNN Version: 8.2. 'Topk' object has no attribute 'delimiter' [{'class_ids': [1], 'scores': [0.79071], 'file_name': '../0017.jpg', 'label_names': []}]

Zing-desire commented 1 year ago

所以,我该怎么做才能显示label_names,我的也是'Topk' object has no attribute 'delimiter' [{'class_ids': [4, 0, 3, 2, 1], 'scores': [0.72924, 0.18635, 0.07128, 0.00756, 0.00555], 'file_name': 'dataset/foods/baby_back_ribs/319516.jpg', 'label_names': []}]