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

Alphapose Onnx and TensorRT models #122

Closed
mrn-mln opened this issue Jan 8, 2021 · 3 comments
Closed

Alphapose Onnx and TensorRT models #122

mrn-mln opened this issue Jan 8, 2021 · 3 comments

Comments

@mrn-mln
Copy link
Contributor

mrn-mln commented Jan 8, 2021

Hi, I've been working on converting Alphapose (the model which contributors have developed for X86 devices at #113) to onnx and tensorRT.
I will send a PR after finishing it. here I wanna share my experience with this procedure.
I tried to convert a Pytorch-based model of HRnet net (one of the available backbones of Alphapose) to Onnx but the path was not straightforward to me.
First of all, I use Pytorch version 1.1.0 for exporting the onnx model but the version was buggy and I faced several errors. after trying some versions of PyTorch finally the below versions worked for me.

`
torch==1.5.1
torchvision==0.6.1

//Expporting parameters
pose_model.load_state_dict(torch.load(MODEL.pt, map_location=map_location))
dummy_input = torch.randn(1, 3, 256, 192, requires_grad=True).cuda()
torch.onnx.export(pose_model, dummy_input, "alphapose.onnx", export_params=True, opset_version=11)
`
Next step, I will check the onnx model results and compare them to the x86 model result in order to make sure that the onnx model is exported successfully.

I will update the procedure here.
please feel free to ask for more details if you need them.

@mrn-mln
Copy link
Contributor Author

mrn-mln commented Oct 13, 2021

Alphapose estimator is converted to TRT and tested on jetson-tx2 (10-12 fps on jetson-tx2 with 2 people on average at each frame)
The source code is available here.

@mrn-mln mrn-mln closed this as completed Oct 13, 2021
@christian-holland
Copy link

christian-holland commented Nov 10, 2021

I will update the procedure here. please feel free to ask for more details if you need them.

Hey sounds great, do you have some more description or a script for the conversion produce?

@mrn-mln
Copy link
Contributor Author

mrn-mln commented Nov 11, 2021

I will update the procedure here. please feel free to ask for more details if you need them.

Hey sounds great, do you have some more description or a script for the conversion produce?

You can check Neuralet website for more information.
https://docs.neuralet.com/en/latest/
https://neuralet.com/products/edge-adaptive-learning/

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

2 participants