Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add paddle quantize model support for ORT, TRT and MKLDNN deploy backend #257

Merged
merged 19 commits into from
Oct 9, 2022
Merged

Add paddle quantize model support for ORT, TRT and MKLDNN deploy backend #257

merged 19 commits into from
Oct 9, 2022

Conversation

yeliang2258
Copy link
Collaborator

@yeliang2258 yeliang2258 commented Sep 19, 2022

PR types

New features

PR changes

Others

Describe

Add paddle quantize model support for ORT, TRT and MKLDNN deploy backend

Running a quantized model is the same as running a non-quantized model and calling the interface, without any special settings

ORT

option = fd.RuntimeOption()
option.use_ort_backend()
option.set_model_path("yolov5s_new_format/model.pdmodel", "yolov5s_new_format/model.pdiparams")

runtime = fd.Runtime(option)
data = np.random.rand(1, 3, 640, 640).astype("float32")
result = runtime.infer({"x2paddle_images":data})

MKLDNN

option = fd.RuntimeOption()
option.use_paddle_backend()
option.set_model_path("yolov5s_new_format/model.pdmodel", "yolov5s_new_format/model.pdiparams")

runtime = fd.Runtime(option)
data = np.random.rand(1, 3, 640, 640).astype("float32")
result = runtime.infer({"x2paddle_images":data})

ONNX-TRT

option = fd.RuntimeOption()
option.use_trt_backend()
option.use_gpu()
option.set_model_path("yolov5s_new_format/model.pdmodel", "yolov5s_new_format/model.pdiparams")

runtime = fd.Runtime(option)
data = np.random.rand(1, 3, 640, 640).astype("float32")
result = runtime.infer({"x2paddle_images":data})

@yeliang2258
Copy link
Collaborator Author

After this PR:PaddlePaddle/Paddle2ONNX#906

@jiangjiajun
Copy link
Collaborator

@jiangjiajun jiangjiajun merged commit 2a68a23 into PaddlePaddle:develop Oct 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants