pytorchx icon indicating copy to clipboard operation
pytorchx copied to clipboard

Will this be able to convert yolov4 of pytorch ?

Open saikrishnadas opened this issue 5 years ago • 6 comments

I have a yolov4.weight file converted to pytorch, and i would like to know if this repo can convert the yolov4.pt to tensorrt ?

saikrishnadas avatar Jun 17 '20 08:06 saikrishnadas

yes, yolov4.pt should also work.

Follow these steps https://github.com/wang-xinyu/tensorrtx/tree/master/yolov4#excute, not using this repo, but using https://github.com/ultralytics/yolov3

wang-xinyu avatar Jun 17 '20 08:06 wang-xinyu

converting darknet to yolov4 works fine. But its too slow to run on my jetson nx (took about 64 secs for detection ). I need to convert the yolov4.pt file into tensorrt, so that the model runs faster

saikrishnadas avatar Jun 17 '20 08:06 saikrishnadas

Follow these steps https://github.com/wang-xinyu/tensorrtx/tree/master/yolov4#excute, to convert yolov4.pt file into tensorrt

wang-xinyu avatar Jun 17 '20 09:06 wang-xinyu

Doesn't that convert yolov4.weight to yolov4.wts and to .engine? I have weight named yolov4.pt

saikrishnadas avatar Jun 17 '20 16:06 saikrishnadas

gen_wts.py can also convert yolov4.pt to yolov4.wts. Can you try it ?

wang-xinyu avatar Jun 18 '20 01:06 wang-xinyu

@wang-xinyu NameError : name 'device' is not defined. in model.load_state_dict(torch.load(weights,map_location=device)['model'])

saikrishnadas avatar Jun 18 '20 04:06 saikrishnadas