模型:
ThomasSimonini/ppo-SpaceInvadersNoFrameskip-v4
这是一个使用 stable-baselines3 库预训练的PPO代理在SpaceInvadersNoFrameskip上玩游戏的模型。它来源于 RL-trained-agents 。
安装了stable-baselines3和huggingface_sb3后,使用这个模型变得很简单:
pip install stable-baselines3 pip install huggingface_sb3
然后,您可以像这样使用模型:
import gym
from huggingface_sb3 import load_from_hub
from stable_baselines3 import PPO
from stable_baselines3.common.evaluation import evaluate_policy
from stable_baselines3.common.env_util import make_atari_env
from stable_baselines3.common.vec_env import VecFrameStack
# Retrieve the model from the hub
## repo_id = id of the model repository from the Hugging Face Hub (repo_id = {organization}/{repo_name})
## filename = name of the model zip file from the repository
checkpoint = load_from_hub(repo_id="ThomasSimonini/ppo-SpaceInvadersNoFrameskip-v4", filename="ppo-SpaceInvadersNoFrameskip-v4.zip")
model = PPO.load(checkpoint)
平均奖励:627.160(162个评估回合)