diff --git a/docs/guide/custom_policy.rst b/docs/guide/custom_policy.rst index 1686258..f8aecfe 100644 --- a/docs/guide/custom_policy.rst +++ b/docs/guide/custom_policy.rst @@ -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 diff --git a/docs/guide/examples.rst b/docs/guide/examples.rst index ed04148..6444608 100644 --- a/docs/guide/examples.rst +++ b/docs/guide/examples.rst @@ -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) --------------------------------- diff --git a/docs/misc/changelog.rst b/docs/misc/changelog.rst index b2cfc2d..53d4457 100644 --- a/docs/misc/changelog.rst +++ b/docs/misc/changelog.rst @@ -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