joschu / modular_rl

Implementation of TRPO and related algorithms

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Action is not within action space error while running Hopper-v1.

sarvghotra opened this issue · comments

I tried to reproduce hopper-v1 on ubuntu on the latest commit, but I am getting the following error/warning. Could you please help me to figure out what I am doing wrong ?

(TheanoEnv)sarv@sarv-HP:~/summer16/modular_rl$ python run_pg.py --gamma=0.995 --lam=0.97 --agent=modular_rl.agentzoo.TrpoAgent --max_kl=0.01 --cg_damping=0.1 --activation=tanh --n_iter=5 --seed=0 --timesteps_per_batch=25000 --env=Hopper-v1 --outfile=./output/Hopper --video=0
Using Theano backend.
[2016-05-28 19:30:58,104] Making new env: Hopper-v1
policy gradient config {'lam': 0.97, 'cg_damping': 0.1, 'env': 'Hopper-v1', 'plot': False, 'activation': 'tanh', 'agent': 'modular_rl.agentzoo.TrpoAgent', 'outfile': './output/Hopper', 'max_kl': 0.01, 'timestep_limit': 1000, 'video': 0, 'snapshot_every': 0, 'parallel': 0, 'n_iter': 5, 'load_snapshot': '', 'filter': 1, 'use_hdf': 0, 'seed': 0, 'hid_sizes': [64, 64], 'timesteps_per_batch': 25000, 'gamma': 0.995, 'metadata': ''}
[2016-05-28 19:31:04,885] Action '[ 0.28600657 1.49202406 -0.23161876]' is not contained within action space 'Box(3,)'.
[2016-05-28 19:31:04,887] Action '[ 0.26071644 -0.87524641 -2.58158255]' is not contained within action space 'Box(3,)'.
[2016-05-28 19:31:04,889] Action '[ 2.35838938 -1.43223417 0.06147718]' is not contained within action space 'Box(3,)'.
[2016-05-28 19:31:04,892] Action '[-0.06937394 1.51615119 1.47848463]' is not contained within action space 'Box(3,)'.
[2016-05-28 19:31:04,897] Action '[-1.92997825 -0.30192277 0.13340396]' is not contained within action space 'Box(3,)'.
[2016-05-28 19:31:04,900] Action '[ 1.23534644 1.18095422 -0.37543115]' is not contained within action space 'Box(3,)'.

I think the issue is because of the new version Hopper-v1 that seems to have different range of action space values.

This is a bug but it won't cause any functional problem. I should modify the code to clip the actions to be within the range. I didn't notice this issue before because Gym didn't print out those warning.

Thanks :)