Open legendxty opened 1 year ago
paddleclas2.5使用MobileNetV3_large_x1_25训练multilabel数据集NUS-SCENE-dataset之后,导出成onnx格式后,onnx推断的结果和原始模型结果对不上,图片传不上来,我把文本结果直接粘贴出来了: 1、原始模型的推断结果: [{'class_ids': [23], 'scores': [0.58354], 'file_name': '/VisualGroup/share5/xty/multi_label/NUS-SCENE-dataset/test_images/0041_2456602544.jpg', 'label_names': []}, {'class_ids': [6, 23, 26], 'scores': [0.98388, 0.98754, 0.95522], 'file_name': '/VisualGroup/share5/xty/multi_label/NUS-SCENE-dataset/test_images/0090_1224483022.jpg', 'label_names': []}]
2、onnx模型的推断结果: [{'class_ids': [6, 9, 10, 11, 13, 17, 20, 22, 25, 30], 'scores': [0.63128, 0.90035, 0.59094, 0.58351, 0.54941, 0.54111, 0.70221, 0.62138, 0.57074, 0.51775], 'file_name': '/VisualGroup/share5/xty/multi_label/NUS-SCENE-dataset/test_images/0041_2456602544.jpg', 'label_names': []}, {'class_ids': [1, 4, 5, 8, 9, 10, 11, 18, 22, 24, 27, 28, 30], 'scores': [0.50695, 0.74952, 0.65327, 0.87077, 0.73512, 0.89273, 0.80755, 0.5755, 0.82439, 0.51918, 0.77082, 0.81393, 0.56884], 'file_name': '/VisualGroup/share5/xty/multi_label/NUS-SCENE-dataset/test_images/0090_1224483022.jpg', 'label_names': []}]
导出onnx的命令是: python3 tools/export_model.py \ -c /VisualGroup/share3/xiatianyu/PaddleClas-release-2.5/ppcls/configs/quick_start/professional/MobileNetV3_multilabel.yaml \ -o Arch.pretrained="/VisualGroup/share3/xiatianyu/PaddleClas-release-2.5/output/MobileNetV3_large_x1_25/best_model"
paddle2onnx --model_dir=./inference \ --model_filename=inference.pdmodel \ --params_filename=inference.pdiparams \ --save_file=./models_onnx/MobileNetV3/inference.onnx \ --opset_version=10 \ --enable_onnx_checker=True
推断onnx的命令是: python3 tools/infer.py \ -c /VisualGroup/share3/xiatianyu/PaddleClas-release-2.5/ppcls/configs/quick_start/professional/MobileNetV3_multilabel.yaml \ -o Global.use_onnx=True \ -o Global.use_gpu=False \ -o Global.inference_model_dir=/VisualGroup/share3/xiatianyu/PaddleClas-release-2.5/models_onnx/MobileNetV3 \ 2>&1 | tee > /VisualGroup/share3/xiatianyu/PaddleClas-release-2.5/logs/infer_MobileNetV3_large_x1_25_onnx.log
hi,麻烦百度网盘分享一下inference model和onnx的model,我这边验证下
paddleclas2.5使用MobileNetV3_large_x1_25训练multilabel数据集NUS-SCENE-dataset之后,导出成onnx格式后,onnx推断的结果和原始模型结果对不上,图片传不上来,我把文本结果直接粘贴出来了: 1、原始模型的推断结果: [{'class_ids': [23], 'scores': [0.58354], 'file_name': '/VisualGroup/share5/xty/multi_label/NUS-SCENE-dataset/test_images/0041_2456602544.jpg', 'label_names': []}, {'class_ids': [6, 23, 26], 'scores': [0.98388, 0.98754, 0.95522], 'file_name': '/VisualGroup/share5/xty/multi_label/NUS-SCENE-dataset/test_images/0090_1224483022.jpg', 'label_names': []}]
2、onnx模型的推断结果: [{'class_ids': [6, 9, 10, 11, 13, 17, 20, 22, 25, 30], 'scores': [0.63128, 0.90035, 0.59094, 0.58351, 0.54941, 0.54111, 0.70221, 0.62138, 0.57074, 0.51775], 'file_name': '/VisualGroup/share5/xty/multi_label/NUS-SCENE-dataset/test_images/0041_2456602544.jpg', 'label_names': []}, {'class_ids': [1, 4, 5, 8, 9, 10, 11, 18, 22, 24, 27, 28, 30], 'scores': [0.50695, 0.74952, 0.65327, 0.87077, 0.73512, 0.89273, 0.80755, 0.5755, 0.82439, 0.51918, 0.77082, 0.81393, 0.56884], 'file_name': '/VisualGroup/share5/xty/multi_label/NUS-SCENE-dataset/test_images/0090_1224483022.jpg', 'label_names': []}]
导出onnx的命令是: python3 tools/export_model.py \ -c /VisualGroup/share3/xiatianyu/PaddleClas-release-2.5/ppcls/configs/quick_start/professional/MobileNetV3_multilabel.yaml \ -o Arch.pretrained="/VisualGroup/share3/xiatianyu/PaddleClas-release-2.5/output/MobileNetV3_large_x1_25/best_model"
paddle2onnx --model_dir=./inference \ --model_filename=inference.pdmodel \ --params_filename=inference.pdiparams \ --save_file=./models_onnx/MobileNetV3/inference.onnx \ --opset_version=10 \ --enable_onnx_checker=True
推断onnx的命令是: python3 tools/infer.py \ -c /VisualGroup/share3/xiatianyu/PaddleClas-release-2.5/ppcls/configs/quick_start/professional/MobileNetV3_multilabel.yaml \ -o Global.use_onnx=True \ -o Global.use_gpu=False \ -o Global.inference_model_dir=/VisualGroup/share3/xiatianyu/PaddleClas-release-2.5/models_onnx/MobileNetV3 \ 2>&1 | tee > /VisualGroup/share3/xiatianyu/PaddleClas-release-2.5/logs/infer_MobileNetV3_large_x1_25_onnx.log