avisingh599 / reward-learning-rl

[RSS 2019] End-to-End Robotic Reinforcement Learning without Reward Engineering
https://sites.google.com/view/reward-learning-rl/
Other
371 stars 68 forks source link

ImportError: cannot import name 'register_goal_example_envs' #32

Open Hc7Hs opened 4 years ago

Hc7Hs commented 4 years ago

Hi, avisingh599 .

I have built docker image from README. But when I run "softlearning run_example_local examples.classifier_rl --n_goal_examples 10 --task=Image48SawyerDoorPullHookEnv-v0 --algorithm VICERAQ --num-samples 5 --n_epochs 300 --active_query_frequency 10" . There is a problem:

Traceback (most recent call last):
  File "/opt/conda/envs/softlearning/bin/softlearning", line 11, in <module>
    load_entry_point('softlearning', 'console_scripts', 'softlearning')()
  File "/softlearning_files/reward-learning-rl/softlearning/scripts/console_scripts.py", line 202, in main
    return cli()
  File "/opt/conda/envs/softlearning/lib/python3.6/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/opt/conda/envs/softlearning/lib/python3.6/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/opt/conda/envs/softlearning/lib/python3.6/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/opt/conda/envs/softlearning/lib/python3.6/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/conda/envs/softlearning/lib/python3.6/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/softlearning_files/reward-learning-rl/softlearning/scripts/console_scripts.py", line 71, in run_example_local_cmd
    return run_example_local(example_module_name, example_argv)
  File "/softlearning_files/reward-learning-rl/examples/instrument.py", line 208, in run_example_local
    example_args = example_module.get_parser().parse_args(example_argv)
  File "/softlearning_files/reward-learning-rl/examples/classifier_rl/__init__.py", line 26, in get_parser
    from .utils import get_parser
  File "/softlearning_files/reward-learning-rl/examples/classifier_rl/utils.py", line 16, in <module>
    from multiworld.envs.mujoco import register_goal_example_envs
ImportError: cannot import name 'register_goal_example_envs'

The pip show that i have installed multiworld and I can import it in python cli:

>>> import multiworld.envs.mujoco as mu
>>> mu
<module 'multiworld.envs.mujoco' from '/opt/conda/envs/softlearning/lib/python3.6/site-packages/multiworld/envs/mujoco/__init__.py'>
>>> dir(mu)
['LOGGER', '_REGISTERED', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', 'create_image_48_sawyer_push_and_reach_arena_env_reset_free_v0', 'create_image_48_sawyer_push_and_reach_arena_env_v0', 'create_image_48_sawyer_reach_xy_env_v1', 'create_image_84_sawyer_reach_xy_env_v1', 'gym', 'logging', 'register', 'register_custom_envs']

It seem like the multiworld.envs.mujoco mudule do not has register_goal_example_envs.

How can I solove this problem? Thanks!

avisingh599 commented 4 years ago

Hi,

The function is defined here: https://github.com/avisingh599/multiworld/blob/99638945399b847b6f1bd31fb982bea48cfe65ed/multiworld/envs/mujoco/__init__.py#L12

Are you using my fork of multiworld linked above? The codebase is supposed to work with the above, not the original multiworld repository.

Thanks, Avi