inverse_rl
inverse_rl copied to clipboard
NotImplementedError with CustomGymEnv ('CustomAnt-v0')
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
could you please tell me how to fix this problem. Thanks
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?
It might be due to a different gym version. We used 0.7.4 version of gym that time.
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
@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
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)