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

Changes in DEP-RL library after myosuite Update #177

Open
YusseffRuiz opened this issue Jun 6, 2024 · 1 comment
Open

Changes in DEP-RL library after myosuite Update #177

YusseffRuiz opened this issue Jun 6, 2024 · 1 comment

Comments

@YusseffRuiz
Copy link

After the last myosuite Update, the Tutorials for training a new policy for MyoSuite locomotion in MyoLeg, and i'm thinking in all other environments, there are a few changes needed to be performed so it can work fine:

Reproduce the Issue:
Install Myosuite.
Prepare Tutorial based on the following:
https://myosuite.readthedocs.io/en/latest/tutorials.html
"DEP-RL baselines"
And Training file with the following:
https://deprl.readthedocs.io/en/latest/loading_checkpoints.html#continuing-training-with-deprl

A new environment is required to be registered in init file in site-packages/deprl/

Afterwards, two error pops out:

Expected float and received Double.

Which can be solved by modifying every torch and arrays of the type float32, and changing them to "double" in the following files inside:
deprl/custom_distributed

Then, an issue with compatibility with the new gym update appears, since "step" and "reset" returns 5 values, instead of 4.

We need to change the following in the file:
deprl/env_wrappers/wrappers

From:


     def step(self, action):
        try:
            observation, reward, done, info= self._inner_step(action)
...

    def reset(self, **kwargs):
        observation = super().reset(**kwargs)

To


    def step(self, action):
        try:
            observation, reward, done, info, extras = self._inner_step(action)

       def reset(self, **kwargs):
        observation, *_ = super().reset(**kwargs)

After these changes, the repository works correctly with different environments.

@P-Schumacher
Copy link
Collaborator

Thanks for the helpful suggestions :)
I have implemented some updates in the deprl repo and the current state of the issue is being tracked here:
martius-lab/depRL#6

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