hill-a / stable-baselines

A fork of OpenAI Baselines, implementations of reinforcement learning algorithms
http://stable-baselines.readthedocs.io/
MIT License
4.16k stars 725 forks source link

[Question] Does loading a model only load the weights, or the hyperparameters as well? #432

Closed maxmatical closed 5 years ago

maxmatical commented 5 years ago

I'm trying to save and load a model multiple times to train on Colab, and I just want to make sure that when I call model.load, I'm using the same hyperparameters as well.

araffin commented 5 years ago

Hello, It does also load the hyperparameters. However, I recommend you to check this issue: #301

You can do a quick check doing:

from stable_baselines import SAC

model = SAC('MlpPolicy', 'Pendulum-v0', buffer_size=123)
model.save('sac_test')

loaded_model = SAC.load('sac_test')
assert loaded_model.buffer_size == 123