Update docs, Provide the env when loading the model (#327) (#330)

* Provide the env when loading the model (#327)

* Update docs/misc/changelog.rst

Co-authored-by: Anssi <kaneran21@hotmail.com>
This commit is contained in:
lorepieri8 2021-02-27 16:24:39 +01:00 committed by GitHub
parent bcb231e249
commit ce3f9e3302
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 6 deletions

View file

@ -42,7 +42,7 @@ using ``policy_kwargs`` parameter:
del model
# the policy_kwargs are automatically loaded
model = PPO.load("ppo_cartpole")
model = PPO.load("ppo_cartpole", env=env)
Custom Feature Extractor

View file

@ -76,7 +76,7 @@ In the following example, we will train, save and load a DQN model on the Lunar
del model # delete trained model to demonstrate loading
# Load the trained agent
model = DQN.load("dqn_lunar")
model = DQN.load("dqn_lunar", env=env)
# Evaluate the agent
# NOTE: If you use wrappers with your environment that modify rewards,
@ -335,9 +335,6 @@ will compute a running average and standard deviation of input features (it can
# To demonstrate loading
del model, env
# Load the agent
model = PPO.load(log_dir + "ppo_halfcheetah")
# Load the saved statistics
env = DummyVecEnv([lambda: gym.make("HalfCheetahBulletEnv-v0")])
env = VecNormalize.load(stats_path, env)
@ -346,6 +343,9 @@ will compute a running average and standard deviation of input features (it can
# reward normalization is not needed at test time
env.norm_reward = False
# Load the agent
model = PPO.load(log_dir + "ppo_halfcheetah", env=env)
Hindsight Experience Replay (HER)
---------------------------------

View file

@ -73,6 +73,7 @@ Documentation:
- Updated custom policy doc (separate policy architecture recommended)
- Added a note about OpenCV headless version
- Corrected typo on documentation (@mschweizer)
- Provide the environment when loading the model in the examples (@lorepieri8)
Pre-Release 0.10.0 (2020-10-28)
@ -548,4 +549,4 @@ And all the contributors:
@flodorner @KuKuXia @NeoExtended @PartiallyTyped @mmcenta @richardwu @kinalmehta @rolandgvc @tkelestemur @mloo3
@tirafesi @blurLake @koulakis @joeljosephjin @shwang @rk37 @andyshih12 @RaphaelWag @xicocaio
@diditforlulz273 @liorcohen5 @ManifoldFR @mloo3 @SwamyDev @wmmc88 @megan-klaiber @thisray
@tfederico @hn2 @LucasAlegre @AptX395 @zampanteymedio @decodyng @ardabbour @lorenz-h @mschweizer
@tfederico @hn2 @LucasAlegre @AptX395 @zampanteymedio @decodyng @ardabbour @lorenz-h @mschweizer @lorepieri8