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

[WIP] Add TorchScript and C++ support #3

Open
wants to merge 2 commits into
base: optimization
Choose a base branch
from

Conversation

Mika412
Copy link

@Mika412 Mika412 commented Jul 11, 2023

This is just the TorchScript code. I still need to do the following tasks:

  • Refactor the main script
  • Fix results bug + add a model results comparison script
  • Fork modified pypose library (here)
  • Fix TorchScript save method
  • Implement C++ sample

@Mika412
Copy link
Author

Mika412 commented Jul 12, 2023

I've added a script based on some of your previous work, to compare the trajectories between the solutions. The TorchScript compiled model gives 1:1 results. but unfortunately, ONNX doesn't. I assume this may be due to the rounding error. Because these values are so small, it may be just rounding them to 0.

Figure_1

@NicolayP
Copy link
Owner

That is when no acitons are applied to the system right? but also that isn't too much of an issue I think, especially when I look at the order of magnitude in the error ~1e-13. That is for a horizon of 20 steps right? How bad is the divergence when you increase that to 50 and 100?

@Mika412
Copy link
Author

Mika412 commented Jul 12, 2023

I'll try to see if I can check it tonight, as it'll take a while to export.

@Mika412
Copy link
Author

Mika412 commented Jul 12, 2023

Checked 50 and 100. ONNX still gives the same result, probably some torch function is getting incorrectly exported. TorchScript is giving exactly the same result as the original model.

Figure_1

Unfortunately, I couldn't finish the save method before I leave. You can either try fixing it yourself or I can continue working on it when I'm back in August.

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

Successfully merging this pull request may close these issues.

2 participants