DeepX-inc / machina

Control section: Deep Reinforcement Learning framework
MIT License
278 stars 45 forks source link

Fix options for ppo and trpo with rnn #192

Closed takerfume closed 5 years ago

takerfume commented 5 years ago

When running python run_trpo.py -rnn or python run_ppo.py -rnn, I got the following error. It is preferable that default options don't cause error. This should be fixed if possible.

Traceback (most recent call last):
  File "run_ppo.py", line 160, in <module>
    optim_pol=optim_pol, optim_vf=optim_vf, epoch=args.epoch_per_iter, batch_size=args.batch_size, max_grad_norm=args.max_grad_norm)
  File "/Users/taketo/deepx/machinamaster/machina/machina/algos/ppo_clip.py", line 126, in train
    for batch in iterator:
  File "/Users/taketo/deepx/machinamaster/machina/machina/traj/traj.py", line 413, in iterate_rnn
    assert batch_size * num_epi_per_seq <= self.num_epi
AssertionError
rarilurelo commented 5 years ago

Meanings of batch_size are different whether rnn or not. This problem can be solved by setting argument of rnn_batch_size.

takerfume commented 5 years ago

@rarilurelo I will assign 32 to the default value of rnn_batch_size. Is it OK?

rarilurelo commented 5 years ago

I think it's too large. 8 would be good.

takerfume commented 5 years ago

206