question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Question] C++ Inference

See original GitHub issue

Question

Hello, I am using SB3 to train some model where I want the inference to run on embedded robots using C++. I had a look at PyTorch documentation and doing this is not very hard “by hand”, but the process could indeed be automated.

I could maybe contribute, but I would like some questions to be answered about how do you imagine the feature.

In my opinion, there is more that can be done that simply documenting it, because we could help to automate the observation and action rescaling and normalizing, in a way such that methods like model.predict gets converted seamlessly to C++.

Here is how I would see it:

  • We provide some piece of C++
  • We provide the methods that export the JIT PyTorch models (.pt) from the different agents implemented in SB3
  • We provide some code that generates some C++ (at least we need to be able to export the action and observation definitions so that the pre/post processing of observations and actions are implemented in C++ as well)

What do you think ?

Additional context

Checklist

  • I have read the documentation (required)
  • I have checked that there is no similar issue in the repo (required)

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:10 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
Gregwarcommented, Mar 31, 2022

I started working on that in the RL Zoo, I will indeed open a draft PR soon, even if it will not support everything it can be used as a base for discussions

I have a very short term goals of embedding inferences in our humanoid robots so I will also be the first user

1reaction
Gregwarcommented, Mar 27, 2022

My list is a list of features.

About questions, I mostly wanted to know what was the recommended direction for this. Making it some contrib to RL Zoo indeed looks like the way to go, since the export can be achieve “from the outside” or SB3.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Inference Definition |Questions and Examples - Hitbullseye
It is a conclusion drawn on the basis of given facts. It is also an ability of a reader or listener to read...
Read more >
Inference Questions || Free SAT Training from AP Guru
Inference questions tend to be among the most challenging types of Reading Comprehension questions on the SAT. Instead of testing your understanding of...
Read more >
Inference Questions on SAT Reading: 6 Strategies
Inference questions ask about the meaning of a line, paragraph, or even an entire passage. The ideas being asked about are not directly...
Read more >
How to Answer Inference Questions - YouTube
You may be wondering what is the best way to answer inference questions ? In this video, I will work through example inference...
Read more >
Inference | Classroom Strategies - Reading Rockets
In this model, teachers pose four questions to students to facilitate a discussion about inferences (Marzano, 2010). The goal is for students to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found