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
1.89k stars 494 forks source link

[Feature Request] Call train from Python code #423

Closed younik closed 7 months ago

younik commented 7 months ago

🚀 Feature

Is there a clean way to call the train code from Python code? If not, it would be nice to have this feature.

We can simply achieve it by outsourcing the argument parsing logic from the main function.

Motivation

No response

Pitch

No response

Alternatives

No response

Additional context

No response

Checklist

araffin commented 7 months ago

Hello,

I have checked that there is no similar issue in the repo

is that what you want: https://github.com/DLR-RM/rl-baselines3-zoo#passing-arguments-in-an-interactive-session ?

See discussion in https://github.com/DLR-RM/rl-baselines3-zoo/issues/297 if you want more granularity, I would recommend using the ExperimentManager class directly: https://github.com/DLR-RM/rl-baselines3-zoo/blob/e4667b60f8dc5a753261770255951cef657770b1/rl_zoo3/train.py#L221-L275

younik commented 7 months ago

Oh, that's correct, thank you. I didn't find it, sorry about that.