Open dddlli opened 11 months ago
@dddlli 这个我遇到过, 将https://github.com/PaddlePaddle/PaddleDetection/blob/develop/ppdet/modeling/transformers/dino_transformer.py 中的相关部分修改下即可:
Thanks for all these great works and suggestion from MINGtoMING.
We could successfully export our trained DINO model (with Focalnet backbone) , but there're some ERROR when we're trying to export from Paddle to ONNX. May we have your advise for this and thanks in advance.
Oops, there are some operators not supported yet, including conditional_block,ms_deformable_attn,select_input
[Information when ERROR]
[Paddle2ONNX] Start to parse PaddlePaddle model...
[Paddle2ONNX] Model file path: inference_model/dino_focal_4scale_2x_coco/model.pdmodel
[Paddle2ONNX] Paramters file path: inference_model/dino_focal_4scale_2x_coco/model.pdiparams
[Paddle2ONNX] Start to parsing Paddle model...
[Paddle2ONNX] Oops, there are some operators not supported yet, including conditional_block,ms_deformable_attn,select_input,
[ERROR] Due to the unsupported operators, the conversion is aborted.
Aborted (core dumped)
[Using packages include Paddle/torch]
paddle-bfloat 0.1.7
paddle2onnx 1.1.0
paddledet 0.0.0
paddlepaddle-gpu 2.5.2
torch 2.0.1+cu118
torch-tensorrt 1.3.0a0
Thanks.
@kidd6566 我使用 此分支 https://github.com/PaddlePaddle/PaddleDetection/tree/develop 是可以正常导出dino onnx模型文件的, 示例步骤如下:
python tools/export_model.py -c configs/dino/dino_r50_4scale_1x_coco.yml -o weights=https://paddledet.bj.bcebos.com/models/dino_r50_4scale_1x_coco.pdparams trt=True
paddle2onnx --model_dir=./output_inference/dino_r50_4scale_1x_coco/ \
--model_filename model.pdmodel \
--params_filename model.pdiparams \
--opset_version 16 \
--save_file dino_r50_4scale_1x_coco.onnx
感谢楼上的小伙伴
问题确认 Search before asking
请提出你的问题 Please ask your question