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

mmdetection model Faster_rcnn failed with pplnn #13

Closed
Maosquerade opened this issue Jul 6, 2021 · 6 comments
Closed

mmdetection model Faster_rcnn failed with pplnn #13

Maosquerade opened this issue Jul 6, 2021 · 6 comments

Comments

@Maosquerade
Copy link

I followed the document of converting model with openmmp and generated pretrained faster_rcnn model , but when I used x86 pplnn to run this model, there is an error says:

[INFO][2021-07-06 08:48:49.498][pplnn.cc:683] ppl.nn version: 7dd75a1077867fc9a762449953417088446ae2f8-dirty
[INFO][2021-07-06 08:48:49.498][pplnn.cc:110] ***** register X86Engine *****
[INFO][2021-07-06 08:48:49.761][simple_graph_partitioner.cc:90] total partition(s) of graph[torch-jit-export]: 1.
[ERROR][2021-07-06 08:48:50.556][kernel.cc:14] reshape kernel[Expand_1100] failed: invalid value
[ERROR][2021-07-06 08:48:50.556][kernel.cc:47] BeforeExecute() of kernel[Expand_1100] failed: invalid value
[ERROR][2021-07-06 08:48:50.556][scheduler_common.cc:153] exec kernel[Expand_1100] failed: invalid value
[ERROR][2021-07-06 08:48:50.556][sequential_scheduler.cc:99] execute kernel[Expand_1100] failed: invalid value
[ERROR][2021-07-06 08:48:50.556][pplnn.cc:784] Run() failed: invalid value

The mobilenet can execute successfully. Can I do anything to make this model execute right?

@openppl-public
Copy link
Collaborator

I followed the document of converting model with openmmp and generated pretrained faster_rcnn model , but when I used x86 pplnn to run this model, there is an error says:

[INFO][2021-07-06 08:48:49.498][pplnn.cc:683] ppl.nn version: 7dd75a1077867fc9a762449953417088446ae2f8-dirty
[INFO][2021-07-06 08:48:49.498][pplnn.cc:110] ***** register X86Engine *****
[INFO][2021-07-06 08:48:49.761][simple_graph_partitioner.cc:90] total partition(s) of graph[torch-jit-export]: 1.
[ERROR][2021-07-06 08:48:50.556][kernel.cc:14] reshape kernel[Expand_1100] failed: invalid value
[ERROR][2021-07-06 08:48:50.556][kernel.cc:47] BeforeExecute() of kernel[Expand_1100] failed: invalid value
[ERROR][2021-07-06 08:48:50.556][scheduler_common.cc:153] exec kernel[Expand_1100] failed: invalid value
[ERROR][2021-07-06 08:48:50.556][sequential_scheduler.cc:99] execute kernel[Expand_1100] failed: invalid value
[ERROR][2021-07-06 08:48:50.556][pplnn.cc:784] Run() failed: invalid value

The mobilenet can execute successfully. Can I do anything to make this model execute right?

Can you post the command sequence that are used to convert the faster-rcnn model?

@Maosquerade
Copy link
Author

My command is just as the insturction of your model-convert-guide , the Example: Converting Faster R-CNN :

cd mmdetection && mkdir checkpoints && cd checkpoints
wget https://download.openmmlab.com/mmdetection/v2.0/faster_rcnn/faster_rcnn_r50_fpn_1x_coco/faster_rcnn_r50_fpn_1x_coco_20200130-047c8118.pth

python ../tools/deployment/pytorch2onnx.py ../configs/faster_rcnn/faster_rcnn_r50_fpn_1x_coco.py \
faster_rcnn_r50_fpn_1x_coco_20200130-047c8118.pth \
--output-file faster_rcnn.onnx --simplify --dynamic-export

@openppl-public
Copy link
Collaborator

My command is just as the insturction of your model-convert-guide , the Example: Converting Faster R-CNN :

cd mmdetection && mkdir checkpoints && cd checkpoints
wget https://download.openmmlab.com/mmdetection/v2.0/faster_rcnn/faster_rcnn_r50_fpn_1x_coco/faster_rcnn_r50_fpn_1x_coco_20200130-047c8118.pth

python ../tools/deployment/pytorch2onnx.py ../configs/faster_rcnn/faster_rcnn_r50_fpn_1x_coco.py \
faster_rcnn_r50_fpn_1x_coco_20200130-047c8118.pth \
--output-file faster_rcnn.onnx --simplify --dynamic-export

We cannot reproduce your problem. Can you send your converted model to openppl.ai@hotmail.com?

@Maosquerade
Copy link
Author

Thanks for relpying! I have sent the model and my environment to your email.

openppl-public added a commit that referenced this issue Jul 7, 2021
@ZichenTian
Copy link
Contributor

ZichenTian commented Jul 7, 2021

Thanks for relpying! I have sent the model and my environment to your email.

We have successfully reproduced your problem on your model. The bug has been fixed and we merged a PR:
#15

By our test, your model now can be infered successfully, and its result is same as onnxruntime.
Please have a try again.

@Maosquerade
Copy link
Author

That worked! Thanks a lot!

Alcanderian pushed a commit to Alcanderian/ppl.nn that referenced this issue Apr 6, 2024
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

No branches or pull requests

3 participants