Views
No views yet
1from stable_baselines3 import ...
2from huggingface_sb3 import load_from_hub
3
4repo_id = "fredchung/ppo-LunarLander-v2" # The repo_id
5filename = "ppo-LunarLander-v2.zip" # The model filename.zip
6
7# For compatibility between pickle protocol 5 vs. 4.
8custom_objects = {
9 "learning_rate": 0.0,
10 "lr_schedule": lambda _: 0.0,
11 "clip_range": lambda _: 0.0,
12}
13
14checkpoint = load_from_hub(repo_id, filename)
15model = PPO.load(checkpoint, custom_objects=custom_objects, print_system_info=True)
16...