open-mmlab / mmdeploy

OpenMMLab Model Deployment Framework
https://mmdeploy.readthedocs.io/en/latest/
Apache License 2.0
2.79k stars 638 forks source link

MMDeploy test.py slower than MMSegmentation deploy_test.py using TensorRT? #76

Closed calvinnguyenq closed 2 years ago

calvinnguyenq commented 2 years ago

Hello, I was using MMDeploy to convert the fastscnn pytorch into a TensorRT engine, which works very well. Testing the TRT model on the MMDeploy tools/test.py results in 10 tasks/second, while testing it on the MMSegmentation tools/deploy_test.py results in 20 tasks/second. Is there reason why the MMDeploy runs slower? I am assuming it is because it was built for a more general case?

Here are the commands I did:

MMDeploy

python tools/test.py configs/mmseg/segmentation_tensorrt_static-1024x2048.py /home/calvinnguyenq/dev/MMSegmentation/mmsegmentation/configs/fastscnn/fast_scnn_lr0.12_8x4_160k_cityscapes.py --model demo/end2end.engine --speed-test --device cuda:0

MMSegmentation

python tools/deploy_test.py configs/fastscnn/fast_scnn_lr0.12_8x4_160k_cityscapes.py demo/end2end.engine --backend tensorrt --eval cityscapes

AllentDan commented 2 years ago

Hi @calvinnguyenq, could you share the converting commands to help me analyze the situation

calvinnguyenq commented 2 years ago

python tools/deploy.py configs/mmseg/segmentation_tensorrt_static-1024x2048.py /home/calvinnguyenq/dev/MMSegmentation/mmsegmentation/configs/fastscnn/fast_scnn_lr0.12_8x4_160k_cityscapes.py /home/calvinnguyenq/dev/MMSegmentation/mmsegmentation/checkpoints/fast_scnn_lr0.12_8x4_160k_cityscapes_20210630_164853-0cec9937.pth /home/calvinnguyenq/dev/MMSegmentation/mmsegmentation/demo/demo.png --work-dir testing --show --device cuda:0

AllentDan commented 2 years ago

What about the converting commands in MMSeg?

calvinnguyenq commented 2 years ago

Oh, I also just used the tensorrt engine I made from MMDeploy, and placed in the MMSegmentation demo folder to test it

calvinnguyenq commented 2 years ago

Hello again, was there any update on this? Thanks

AllentDan commented 2 years ago

Oh, I also just used the tensorrt engine I made from MMDeploy, and placed in the MMSegmentation demo folder to test it

Hi, sorry for the late reply. In my experiment, the speed in MMDeploy and MMSegmentation are nearly the same. 8.2 tasks/s for MMDeploy and 8.1 tasks/s for MMSegmentation. My testing card is 1660.

lvhan028 commented 2 years ago

CLose since no activity for quite a long time