openai / baselines

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

ValueError: cannot copy sequence with size 84 to array axis with dimension 4 #892

Open odats opened 5 years ago

odats commented 5 years ago

python -m baselines.run --alg=deepq --env=PongNoFrameskip-v4 --num_timesteps=1e5 --print_freq=10 --save_path=~/models/pong

python -m baselines.run --alg=deepq --env=PongNoFrameskip-v4 --num_timesteps=0 --load_path=~/models/pong --play

Loaded model from ~/models/pong
Running trained model
Traceback (most recent call last):
  File "/Users/odats/anaconda3/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/Users/odats/anaconda3/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/Users/odats/Documents/Projects/uku/uku-ml-project/baselines/baselines/run.py", line 244, in <module>
    main(sys.argv)
  File "/Users/odats/Documents/Projects/uku/uku-ml-project/baselines/baselines/run.py", line 228, in main
    actions, _, _, _ = model.step(obs)
  File "/Users/odats/Documents/Projects/uku/uku-ml-project/baselines/baselines/deepq/deepq.py", line 53, in step
    return self._act([observation], **kwargs), None, None, None
  File "/Users/odats/Documents/Projects/uku/uku-ml-project/baselines/baselines/deepq/build_graph.py", line 198, in act
    return _act(ob, stochastic, update_eps)
  File "/Users/odats/Documents/Projects/uku/uku-ml-project/baselines/baselines/common/tf_util.py", line 179, in <lambda>
    return lambda *args, **kwargs: f(*args, **kwargs)[0]
  File "/Users/odats/Documents/Projects/uku/uku-ml-project/baselines/baselines/common/tf_util.py", line 208, in __call__
    self._feed_input(feed_dict, inpt, value)
  File "/Users/odats/Documents/Projects/uku/uku-ml-project/baselines/baselines/common/tf_util.py", line 196, in _feed_input
    feed_dict.update(inpt.make_feed_dict(value))
  File "/Users/odats/Documents/Projects/uku/uku-ml-project/baselines/baselines/deepq/utils.py", line 38, in make_feed_dict
    return {self._placeholder: adjust_shape(self._placeholder, data)}
  File "/Users/odats/Documents/Projects/uku/uku-ml-project/baselines/baselines/common/tf_util.py", line 394, in adjust_shape
    data = np.array(data)
ValueError: cannot copy sequence with size 84 to array axis with dimension 4
HuangHaoyu1997 commented 5 years ago

I meet same problem, did you fix it?Thx.

odats commented 5 years ago

No, I didn't.

On Wed, May 15, 2019 at 17:38 Haoyu Huang notifications@github.com wrote:

I meet same problem, did you fix it?Thx.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/openai/baselines/issues/892?email_source=notifications&email_token=AAHGR66ZIDULBYH2YL7CQLDPVQN7XA5CNFSM4HKSJPTKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVO35HQ#issuecomment-492682910, or mute the thread https://github.com/notifications/unsubscribe-auth/AAHGR6YV4MMXAS4MZQARRG3PVQN7XANCNFSM4HKSJPTA .

-- oleg dats Founder and CEO [image: TechMagic Logo] https://www.techmagic.co/ Skype: oleg.dats Linkedin: Oleg Dats https://www.linkedin.com/in/odats

batist73 commented 5 years ago

I created PR #907 for this issue.

pzhokhov commented 5 years ago

@odats @HuangHaoyu1997 which version of numpy are you using? I am running these very commands on master (except made number of steps smaller in the first command), and it seems to work for me

pzhokhov commented 5 years ago

actually, nvm, my bad, I can reproduce this after all with numpy 1.16.4 (latest as of now)

MakisKans commented 4 years ago

I also face this issue. Any solutions?

pzhokhov commented 4 years ago

I think it can be fixed by upgrading numpy after all to 1.17 (versions 1.17.0 and 1.17.4 seem to work)

ninulik82 commented 4 years ago

Hello, did anyone fix this issue? I am running into the same problem.

Thanks