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

Error Training MyoLeg Agent with depRL #185

Open
nikypopov opened this issue Jul 10, 2024 · 1 comment
Open

Error Training MyoLeg Agent with depRL #185

nikypopov opened this issue Jul 10, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@nikypopov
Copy link

Issue: Error Training MyoLeg Agent with depRL

Hello!

I'm running into an error when trying to train the MyoLeg agent with depRL. Specifically, following this example

Steps to Reproduce

  1. Attempt to Train Agent:

    python -m deprl.main baselines_DEPRL/myoLegWalk.json

    Error:

    raise error.NameNotFound(
    gym.error.NameNotFound: Environment myoLegWalk doesn't exist.
    

I was able to reproduce the same error when just attempting to load a pre-trained depRL model with the following script:

  1. Load depRL Baseline for Walking:

    import gym
    import myosuite
    import deprl
    
    # we can also change the reset_type of the environment here
    env = gym.make('myoLegWalk-v0', reset_type='random')
    policy = deprl.load_baseline(env)
    
    for ep in range(5):
        obs, _ = env.reset()
        for i in range(1000):
            action = policy(obs)
            next_obs, reward, done, truncated, info = env.step(action)
            env.sim.renderer.render_to_window()
            obs = next_obs
            if done:
                break

    Error:

    raise error.NameNotFound(
    gym.error.NameNotFound: Environment myoLegWalk doesn't exist.

And this error could be resolved changing the import statement for gym to:

from myosuite.utils import gym

This does fix the issue in the above example script but does not resolve the training error.

  1. Attempted to Edit .json configuration file:
    I also tried changing the header tab in the configuration myoLegWalk.json file to:
 "tonic": {
     "header": "import deprl, myosuite\nfrom myosuite.utils import gym",   

however this didn't fix the issue and returned the same error.

I'm wondering if this has anything to do with a myosuite-gym (or gymnaisum) update? Any help would be greatly appreciated, thanks!

Configuration and Environment

MacOS Configuration:

  • MacOS 14.4.1
  • Python 3.8.19
  • depRL 0.3.2
  • MyoSuite 2.4.0

Linux Configuration:

  • Python 3.9.19
  • depRL 0.4.0
  • MyoSuite 2.4.0

On Linux, attempting to train the MyoLeg agent yielded:

raise error.UnregisteredEnv('No registered env with id: {}'.format(id)) gym.error.UnregisteredEnv: No registered env with id:  myoLegWalk-v0
@P-Schumacher
Copy link
Collaborator

tracked here martius-lab/depRL#6

@P-Schumacher P-Schumacher added the bug Something isn't working label Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants