DLR-RM / rl-baselines3-zoo

A training framework for Stable Baselines3 reinforcement learning agents, with hyperparameter optimization and pre-trained agents included.
https://rl-baselines3-zoo.readthedocs.io
MIT License
2.06k stars 515 forks source link

RL Zoo CLI #191

Closed araffin closed 2 years ago

araffin commented 2 years ago

It would be nice to have a cli that is available everywhere (with completion too), something like:

sb3 train --algo ppo --env CartPole-v1  
sb3 train --algo ppo --env CartPole-v1  -i custom_params.yaml # allow overwriting hyperparams file with a custom one
sb3 enjoy --algo sac --env Pendulum-v0
sb3 plot_train -a a2c -e Breakout
sb3 plot_eval ...
sb3 plot_from_file
kachayev commented 2 years ago

Hey @araffin! I've recently done simple console_scripts entry point for the package (to help running scripts from folders with custom code). I can polish it and submit PR. It seems like entry point is the most reliable way for this to work on different platforms. Though a few caveats:

araffin commented 2 years ago

Hello, thanks for the proposal =)

and in this case sb3 would be available only within active env.

yes, that's what I meant by "everywhere" (more in the sense "from every folder rather than from every env")

Completion is somewhat complicated functionality to get reliable on multiple platforms/terminals

that's true, but I had in mind to provide only minimal completion (different first level command), at least for bash/zsh users. I did that in the past for a wrapper around conan that tries to mimic conda env.

I've recently done simple console_scripts entry point for the package

You can submit a draft PR yes, but I'm not sure what you mean exactly by "console scripts". (I also have private code of a cli I created for another purpose (but not for the zoo))

kachayev commented 2 years ago

console_scripts is one the functionality setuptools provides for automatically generating script wrappers for modules within the packages, link to their docs.