1. 训练模型
通过
PaddleDetection ppyoloe训练得到动态图模型
2. 导出模型
python tools/export_model.py -c configs/smalldet/ppyoloe_p2_crn_l_80e_sliced_DOTA_500_025.yml --output_dir=./inference_model -o weights=output/ppyoloe_p2_crn_l_80e_sliced_DOTA_500_025/best_model
3、转换成onnx模型
paddle2onnx --model_dir ./inference_model/ppyoloe_p2_crn_l_80e_sliced_DOTA_500_025 --model_filename model.pdmodel --params_filename model.pdiparams --opset_version 11 --save_file model_final.onnx --enable_dev_version True
4、onnx模型转bmodel
paddle2onnx --model_dir ./inference_model_final/ppyoloe_p2_crn_l_80e_sliced_DOTA_500_025 --model_filename model.pdmodel --params_filename model.pdiparams --opset_version 11 --save_file model_final.onnx --enable_dev_version True
5. 转换paddled的onnx至bmodel
转mlir:
model_transform.py --model_name YOLOv3 --model_def ../yolov3.onnx --input_shapes [[1,3,640,640],[1,2]] --mlir yolov3.mlir
转f16:
model_deply.py --mlir yolov3.mlir --quan
tize F16 --chip bm1684x --model yolov3_1684x_f16.bmodel
问题:转换为f16时,卡死不动,也没有模型生成,卡死截图如下:
卡死代码:
clusters idx(size]: (1)process base group 13,layer num 1 ,cluster num lclusters idx(size): (1), 1(1), 2(1)3(1),4(1),5(1),6(1), 7(1),8(1), 9(1),orocess base group 14, layer num l0, cluster num-10Searching best group slices ...
#] 100%
lusters idx(size): 0(1)cluster num-lrocess base group 15, layer num 1,lusters idx(size): (1), 1(1), 2(1)process base group 16, layer num 3, cluster num 3Searching best group slices ...
#] 100%
clusters idx(size): 0(1)orocess base group 17layer num1,cluster numllusters idx(size]: (1)
orocess base group 18,layer num l, cluster num lclusters idx(size]: (1)orocess base group 19, layer num l, cluster num l
clusters idx(size): 0(1),
orocess base group 20, layer num l, cluster num lclusters idx(size): 0(1), 1(), 2(1), 3(1), 4(1), 5(1),6(1), 7(1), 8(1), 9(1),orocess base group 21, layer num-l0, cluster num-l0Searching best group slices ...
#] 100%
本#clusters idx(size): (1)process base group 22, layer num l, cluster num lclusters idx(size): 0(1), 1(1), 2(1)process base group 23, layer num 3, cluster num 3Searching best group slices ...
#] 100%
lusters idx(size): 0(1)cluster num-lrocess base group 24layer num l,usters idxlsizel: 01
rocessbase group 25layer num 1,cluster num-llusters idx(size): 0(1)layer num-l, cluster num-lrocess base group 26,lusters idx(size): 0(1)
rocess base group 27,layer numl, cluster num llusters idx(size): (1), 1(1), 2(1), 3(1),rocess base group 28, layer num-4,cluster num-4earching best group slices ...
#] 100%lusters idx(size): 0(1)orocess base group 29, layer num lcluster num-l5(1),6(1)clusters idx(size): (1), 1(1),2(1),3(1), 4(1),orocess base group 30, layer num 7, cluster num-7