wang-xinyu / pytorchx

Implement popular deep learning networks in pytorch, used by tensorrtx.
MIT License
187 stars 66 forks source link

Will this be able to convert yolov4 of pytorch ? #1

Open saikrishnadas opened 4 years ago

saikrishnadas commented 4 years ago

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 ?

wang-xinyu commented 4 years ago

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

saikrishnadas commented 4 years ago

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

wang-xinyu commented 4 years ago

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

saikrishnadas commented 4 years ago

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

wang-xinyu commented 4 years ago

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

saikrishnadas commented 4 years ago

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