mmdeploy
mmdeploy copied to clipboard
Add mmflow to mmdeploy
Motivation
I want to add mmflow to mmdeploy,now I have implemented the conversion of the mmflow raft model to onnx.
Modification
Add mmflow to mmdeploy/codebase and mmdeply/config
Most tracerwarning can be ignored if the exporter can produce the model you want. Adding a rewriter to fix the warning might bring some trouble. The rewriter could broken if mmflow update their codes. DO NOT add rewriter unless it is necessary.
I have remove these unnecessary rewrite ,and verify the result of onnx model. @grimoire @lvhan028 @ouonline @tehkillerbee
@pedroHuang123 Hi, any update on this PR?
@pedroHuang123 Hi, any update on this PR?
hello, are there any problems with this PR?
@pedroHuang123 Hi, any update on this PR?
hello, are there any problems with this PR?
Some ci failed, could fix them? BTW, pls sign the cla
@pedroHuang123 Hi, any update on this PR?
hello, are there any problems with this PR?
Some ci failed, could fix them? BTW, pls sign the cla
@pedroHuang123 Hi, any update on this PR?
hello, are there any problems with this PR?
Some ci failed, could fix them? BTW, pls sign the cla I have signed the cla,but I do not know how to fix these ci checks?
For lint error, please install pre-commit on your local host
pip install -U pre-commit
cd mmdeploy
pre-commit install
Then run the following command to check the errors
pre-commit run --all-files
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
DESKTOP-UJGOP82\kandao seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it.
Why the status still pending?
@pedroHuang123 Hi, any update on this PR?
hello, are there any problems with this PR?
Some ci failed, could fix them? BTW, pls sign the cla
I have fixed these ci check, please review the code.thanks
@pedroHuang123 Hi, could you give us the model config link of mmflow you tested on this PR?
This is the link: https://download.openmmlab.com/mmflow/raft/raft_8x2_100k_mixed_368x768.py @RunningLeon
Now I just complete the export of torch to onnx,not include SDK . and I find that it takes long time to export mmflow raft model to onnx model (one hours). I hope mmdeploy help analyze the cause. Thanks
Please provide a script about how to convert the model.
Please provide a script about how to convert the model.
from mmdeploy.apis import torch2onnx import onnx import os imgs = ['mmflow/demo/frame_0001.png','mmflow/demo/frame_0002.png'] work_dir = 'work_dir/onnx/raft' save_file = 'raft_mixed.onnx' deploy_cfg = 'mmdeploy/configs/mmflow/raft/opticalflow_onnxruntime_static.py' model_cfg = 'D:\KdWork\OpenmmLab\mmflow\configs\raft\raft_8x2_100k_mixed_368x768.py' model_checkpoint = 'mmflow/checkpoints/raft_8x2_100k_mixed_368x768.pth'
device = 'cuda'
1. convert model to onnx
torch2onnx(imgs, work_dir, save_file, deploy_cfg, model_cfg,model_checkpoint, device)
# 2. check onnx model
onnx_model = onnx.load(os.path.join(work_dir,save_file)) try: onnx.checker.check_model(onnx_model) except Exception: print("Model Incorrect") else: print("Model correct") print("over")
mmflow still not added to mmdeploy?