araffin / robotics-rl-srl

S-RL Toolbox: Reinforcement Learning (RL) and State Representation Learning (SRL) for Robotics
https://s-rl-toolbox.readthedocs.io
MIT License
598 stars 90 forks source link

[bug report] sac, ddpg, deepq: train.py: error: unrecognized arguments: --policy #43

Open ncble opened 5 years ago

ncble commented 5 years ago

Describe the bug In the scripts rl_baselines/rl_algorithm/sac.py, deepq.py, ddpg.py:

  def customArguments(self, parser):
    ## forget to add: super().customArguments(parser)

Code example The following command line reproduces the issue:

araffin commented 5 years ago

Hello, Recurrent policies are not supported by those algorithms. Anyway, it seems also like a legit bug, thanks.

kalifou commented 5 years ago

Hi, thanks for noticing the bug. As the repository as been updated few hours ago (pending PR now closed), these policies are now available policy_fn = {'cnn': "CnnPolicy", 'cnn-lstm': "CnnLstmPolicy", 'cnn-lnlstm': "CnnLnLstmPolicy", 'mlp': "MlpPolicy", 'lstm': "MlpLstmPolicy", 'lnlstm': "MlpLnLstmPolicy"}[args.policy] (see rl_baselines/base_classes.py, L241)

and it seems like your fix might work.