openai / baselines

OpenAI Baselines: high-quality implementations of reinforcement learning algorithms
MIT License
15.81k stars 4.88k forks source link

`FetchPickAndPlace-v1`: AssertionError: Can only deal with Discrete and Box observation spaces for now #738

Closed gtatiya closed 5 years ago

gtatiya commented 5 years ago

I am trying to learn how to run the baseline for the Fetch robot environment. But, when I run the code: python -m baselines.run --alg=ppo2 --env=FetchPickAndPlace-v1 --num_timesteps=30000 --nsteps=128

I got following error:

/home/gyan/Downloads/gym-master/gym/envs/registration.py:14: PkgResourcesDeprecationWarning: Parameters to load are deprecated.  Call .resolve and .require separately.
  result = entry_point.load(False)
Training ppo2 on robotics:FetchPickAndPlace-v1 with arguments 
{'nsteps': 128, 'network': 'mlp'}
Traceback (most recent call last):
  File "/home/gyan/anaconda2/envs/py3_6/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/home/gyan/anaconda2/envs/py3_6/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/gyan/Downloads/baselines-master/baselines/run.py", line 226, in <module>
    main(sys.argv)
  File "/home/gyan/Downloads/baselines-master/baselines/run.py", line 198, in main
    model, env = train(args, extra_args)
  File "/home/gyan/Downloads/baselines-master/baselines/run.py", line 81, in train
    **alg_kwargs
  File "/home/gyan/Downloads/baselines-master/baselines/ppo2/ppo2.py", line 108, in learn
    max_grad_norm=max_grad_norm)
  File "/home/gyan/Downloads/baselines-master/baselines/ppo2/model.py", line 34, in __init__
    act_model = policy(nbatch_act, 1, sess)
  File "/home/gyan/Downloads/baselines-master/baselines/common/policies.py", line 129, in policy_fn
    X = observ_placeholder if observ_placeholder is not None else observation_placeholder(ob_space, batch_size=nbatch)
  File "/home/gyan/Downloads/baselines-master/baselines/common/input.py", line 25, in observation_placeholder
    'Can only deal with Discrete and Box observation spaces for now'
AssertionError: Can only deal with Discrete and Box observation spaces for now

OS: Ubuntu 16.04 Python Python 3.6.7

Please Help !!!

pzhokhov commented 5 years ago

See here: https://github.com/openai/baselines/issues/380. More principled patch is coming soon, with a refactor of HER code (in the internal review at the moment)

pzhokhov commented 5 years ago

should be fixed now, closing this.