FinRL icon indicating copy to clipboard operation
FinRL copied to clipboard

How to SAVE a trained model with SB3?

Open julianzero opened this issue 1 year ago • 1 comments

Hi AI4Finance,

When going through the code in the tutorials, I found that ElegantRL trained models and saved simultaneously, but SB3 did not. I want to reuse the models trained by SB3 without re-training, which is too time consuming.

Thanx.

julianzero avatar Feb 28 '23 16:02 julianzero

# Instantiate the agent model = DQN("MlpPolicy", env, verbose=1) # Train the agent and display a progress bar model.learn(total_timesteps=int(2e5), progress_bar=True) # Save the agent model.save("dqn_lunar") del model # delete trained model to demonstrate loading

This takes 5 seconds to search. Basic Usage: Training, Saving, Loading

notBradPitt avatar Apr 02 '23 11:04 notBradPitt