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

NotImplementedError with CustomGymEnv ('CustomAnt-v0') #1

Open
lnj0532 opened this issue Jan 9, 2019 · 5 comments
Open

NotImplementedError with CustomGymEnv ('CustomAnt-v0') #1

lnj0532 opened this issue Jan 9, 2019 · 5 comments

Comments

@lnj0532
Copy link

lnj0532 commented Jan 9, 2019

Thank you very much for releasing your code. When I run ant_data_collect.py with 'CustomAnt-v0' environment, some problem occured,

Traceback (most recent call last):
File "/home/xxx/anaconda3/lib/python3.6/multiprocessing/pool.py", line 119, in worker
result = (True, func(*args, **kwds))
File "/home/xxx/anaconda3/lib/python3.6/multiprocessing/pool.py", line 44, in mapstar
return list(map(*args))
File "/home/xxx/inverse_rl_eairl/inverse_rl/utils/hyper_sweep.py", line 47, in kwargs_wrapper
return method(**args)
File "ant_data_collect.py", line 16, in main
env = TfEnv(CustomGymEnv('CustomAnt-v0', record_video=False, record_log=False, force_reset=False))
File "/home/xxx/inverse_rl_eairl/inverse_rl/envs/env_utils.py", line 123, in init
video_schedule=FixedIntervalVideoSchedule(50), force_reset=force_reset)
File "/home/xxx/inverse_rl_eairl/inverse_rl/envs/env_utils.py", line 35, in init
env = gym.envs.make(env_name)
File "/home/xxx/software/gym_origin_no_vel/gym/envs/registration.py", line 167, in make
return registry.make(id)
File "/home/xxx/software/gym_origin_no_vel/gym/envs/registration.py", line 119, in make
env = spec.make()
File "/home/xxx/software/gym_origin_no_vel/gym/envs/registration.py", line 86, in make
env = cls(**self._kwargs)
File "/home/xxx/inverse_rl_eairl/inverse_rl/envs/ant_env.py", line 209, in init
mujoco_env.MujocoEnv.init(self, f.name, 5)
File "/home/xxx/software/gym_origin_no_vel/gym/envs/mujoco/mujoco_env.py", line 42, in init
observation, _reward, done, _info = self.step(np.zeros(self.model.nu))
File "/home/xxx/software/gym_origin_no_vel/gym/core.py", line 62, in step
raise NotImplementedError
NotImplementedError
"""

The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "ant_data_collect.py", line 41, in
run_sweep_parallel(main, params_dict, repeat=4)
File "/home/xxx/inverse_rl_eairl/inverse_rl/utils/hyper_sweep.py", line 57, in run_sweep_parallel
pool.map(kwargs_wrapper, exp_args)
File "/home/xxx/anaconda3/lib/python3.6/multiprocessing/pool.py", line 266, in map
return self._map_async(func, iterable, mapstar, chunksize).get()
File "/home/xxx/anaconda3/lib/python3.6/multiprocessing/pool.py", line 644, in get
raise self._value
NotImplementedError

could you please tell me how to fix this problem.
Thanks

@lujiayou123
Copy link

multiprocessing/pool.py", line 608, in get
raise self._value
NotImplementedError
Exception ignored in: <_io.TextIOWrapper name='' mode='w' encoding='UTF-8'>
BrokenPipeError: [Errno 32] Broken pipe

I have encountered the same problem as you!!!
I can't solve it.
Have you fixed the problem yet?

@ahq1993
Copy link
Owner

ahq1993 commented Apr 2, 2019

It might be due to a different gym version. We used 0.7.4 version of gym that time.

@lujiayou123
Copy link

No ''gaussian_mlp_inverse_policy.py'' in my rllab/sandbox/rocky/tf/policies,
neither in https://github.com/rll/rllab/tree/master/sandbox/rocky/tf/policies.

python ant_irl.py
Traceback (most recent call last):
File "ant_irl.py", line 10, in
from sandbox.rocky.tf.policies.gaussian_mlp_inverse_policy import GaussianMLPInversePolicy
ImportError: No module named 'sandbox.rocky.tf.policies.gaussian_mlp_inverse_policy'

@ahq1993
Copy link
Owner

ahq1993 commented Apr 4, 2019

@lujiayou123 Sorry for the trouble. I have included the gaussain_mlp_inverse_policy.py file in my git. You will have to manually copy it to the sandbox/rocky/tf/policies folder and then the code should work fine. Thanks

@Usaywook
Copy link

Usaywook commented Oct 29, 2020

Although I copy the gaussain_mlp_inverse_policy.py file to the sandbox/rocky/tf/policies folder, I get the below error. @ahq1993
Did you update rllab repository??

Traceback (most recent call last):
  File "ant_irl.py", line 65, in <module>
    main()
  File "ant_irl.py", line 54, in main
    baseline=LinearFeatureBaseline(env_spec=env.spec),
  File "/media/usaywook/inverse_rl/inverse_rl/utils/hyperparametrized.py", line 27, in init_wrapper
    return old_init(inst, *args, **kwargs)
  File "/media/usaywook/inverse_rl/inverse_rl/algos/irl_trpo.py", line 19, in __init__
    super(IRLTRPO, self).__init__(optimizer=optimizer, **kwargs)
  File "/media/usaywook/inverse_rl/inverse_rl/utils/hyperparametrized.py", line 27, in init_wrapper
    return old_init(inst, *args, **kwargs)
  File "/media/usaywook/inverse_rl/inverse_rl/algos/irl_npo.py", line 33, in __init__
    super(IRLNPO, self).__init__(**kwargs)
  File "/media/usaywook/inverse_rl/inverse_rl/utils/hyperparametrized.py", line 27, in init_wrapper
    return old_init(inst, *args, **kwargs)
  File "/media/usaywook/inverse_rl/inverse_rl/algos/irl_batch_polopt.py", line 136, in __init__
    self.init_opt()
  File "/media/usaywook/inverse_rl/inverse_rl/algos/irl_npo.py", line 124, in init_opt
    pred = dist.log_likelihood(dist.sample(dist_info_vars),dist_info_vars)+empw_var
  File "/media/usaywook/rllab/sandbox/rocky/tf/distributions/diagonal_gaussian.py", line 80, in sample
    rnd = np.random.normal(size=means.shape)
  File "mtrand.pyx", line 1654, in mtrand.RandomState.normal
  File "mtrand.pyx", line 242, in mtrand.cont2_array_sc
TypeError: __index__ returned non-int (type NoneType)

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

4 participants