myosuite
myosuite copied to clipboard
Error Training MyoLeg Agent with depRL
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
-
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:
-
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.
- 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