wang-xinyu / tensorrtx

Implementation of popular deep learning networks with TensorRT network definition API
MIT License
6.87k stars 1.76k forks source link

converting yolov4-tiny.weights to tensorrt.engine #765

Closed revanb88 closed 2 years ago

revanb88 commented 2 years ago

Env

About this repo

Your problem

revanb88 commented 2 years ago

Hi, I am facing issue while converting yolov4-tiny.weights to tensorrt.engine following link https://github.com/wang-xinyu/tensorrtx/tree/master/yolov3-tiny GPU - V100 cuda - 11.4 ubuntu - 18.04

Traceback (most recent call last): File "gen_wts.py", line 12, in load_darknet_weights(model, weights) File "/home/brevanasiddappa/tensorrt-tiny/yolov3/models.py", line 392, in load_darknetweights conv.weight.data.copy(torch.from_numpy(weights[ptr:ptr + nw]).view_as(conv.weight)) RuntimeError: shape '[256, 384, 3, 3]' is invalid for input of size 695826

wang-xinyu commented 2 years ago

yolov4-tiny is not supported, you need to adapt it by yourself.

revanb88 commented 2 years ago

thank you

On Tue, Oct 19, 2021 at 8:37 AM Wang Xinyu @.***> wrote:

yolov4-tiny is not supported, you need to adapt it by yourself.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/wang-xinyu/tensorrtx/issues/765#issuecomment-946327887, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWDAXTMDLPRWSQV5VVHXWJLUHTOHFANCNFSM5GHBMDMA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

-- Thanks and Regards Dr. Revanasiddappa M Biradar Data Scientist Bengaluru

MHGL commented 2 years ago

@revanb88

# https://github.com/ultralytics/yolov3.git  models.py line 351-354
# set cutoff = 15
# will get yolov4-tiny.wts

but while convert wts to engine, i got this error:

[11/08/2021-17:11:33] [E] [TRT] Parameter check failed at: ../builder/Network.cpp::addScale::482, condition: shift.count > 0 ? (shift.values != nullptr) : (shift.values == nullptr)
mingwz commented 2 years ago

Hello, I have encountered a similar problem, and when I converted to yolov4, I got the following error: jeston nano cuda - 10.2 ubuntu - 18.04

Traceback (most recent call last): File "gen_wts.py", line 12, in load_darknet_weights(model, weights) File "/home/zmw/yolov3/models.py", line 392, in load_darknetweights conv.weight.data.copy(torch.from_numpy(weights[ptr:ptr + nw]).view_as(conv.weight)) RuntimeError: shape '[1024, 512, 3, 3]' is invalid for input of size 4559937 How should i solve it?

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.