Instructions to use elliemci/tqc-PandaPickAndPlace-v3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- stable-baselines3
How to use elliemci/tqc-PandaPickAndPlace-v3 with stable-baselines3:
from huggingface_sb3 import load_from_hub checkpoint = load_from_hub( repo_id="elliemci/tqc-PandaPickAndPlace-v3", filename="{MODEL FILENAME}.zip", ) - Notebooks
- Google Colab
- Kaggle
TQC + HER agent playing PandaPickAndPlace-v3
A TQC agent with Hindsight Experience Replay trained with
SB3-Contrib through the
RL-Zoo on the sparse-reward robot task
PandaPickAndPlace-v3 (panda-gym 3, gymnasium).
It is a "beyond the course" follow-up to Unit 6 of the Hugging Face Deep RL Course, where an A2C agent never learned this task.
The task is not solved: after 2M steps the agent succeeds in a bit under half of the episodes.
Results
Deterministic actions, fixed evaluation seed, training seed 0. Success is info["is_success"] on the last step of the episode.
The published model is the run after 2,000,000 training steps (resumed from checkpoints after disconnects), evaluated on 500 episodes:
44.2% success, mean reward -30.86 +/- 21.70, mean episode length 31.3 (95% interval on the success rate about +/- 4.4 points).
| agent | steps | evaluation episodes | success rate | mean reward +/- std | mean episode length |
|---|---|---|---|---|---|
| A2C (Unit 6) | ~1M | 100 | 3% | -48.50 +/- 8.53 | 48.5 |
| TQC + HER (this model) | 2M | 100 | 45% | -30.41 +/- 21.89 | 30.9 |
| TQC + HER (earlier checkpoint of this run) | 1M | 500 | 37.8% | -34.06 +/- 20.68 | 34.4 |
| TQC + HER (this model) | 2M | 500 | 44.2% | -30.86 +/- 21.70 | 31.3 |
Compare A2C and TQC on the two 100-episode rows (there is no 500-episode A2C evaluation), and 1M vs 2M on the two 500-episode rows.
From 1M to 2M the gain is about 6 points, with an interval of similar size: "slightly better" is what the data supports. One training seed only.
results.json in this repo is the 10-episode check that package_to_hub runs when uploading, not these numbers.
Success rate over 20 evaluation episodes every 50k steps. The run was resumed at 0.9M, 1.0M and 1.8M (dotted lines); the 1.85M point is taken from the resumed run. Averages per half-million steps: 17.5%, 36.5%, 41.5%, 54%. Individual points are very noisy, and the 500-episode evaluation at 2M (44.2%) is below the 54% average of the last half-million of training evaluations; I have not investigated why. The raw data and the plotting script are in the GitHub repo.
Training
- Hyperparameters: RL-Zoo
tqc.yml"her-defaults" (the entry used byPandaPickAndPlace-v1there), registered unchanged under the v3 id:MultiInputPolicy,HerReplayBuffer(goal_selection_strategy="future", n_sampled_goal=4), buffer 1M, batch 2048, gamma 0.95, lr 1e-3, tau 0.05, net[512, 512, 512], 2 critics, 2M steps in total, no observation normalization. - Versions: rl_zoo3 2.9.2, sb3-contrib 2.9.2, stable-baselines3 2.9.2, panda-gym 3.0.7, gymnasium 1.0.0.
- Code, config and the Colab notebook: https://github.com/elliemci/deep-rl/tree/main/units/unit6-a2c-robotics.
Usage
import gymnasium as gym, panda_gym
from huggingface_sb3 import load_from_hub
from sb3_contrib import TQC
from stable_baselines3.common.vec_env import DummyVecEnv
path = load_from_hub("elliemci/tqc-PandaPickAndPlace-v3", "tqc-PandaPickAndPlace-v3.zip")
env = DummyVecEnv([lambda: gym.make("PandaPickAndPlace-v3")])
model = TQC.load(path, env=env) # HerReplayBuffer needs an env at load time
obs = env.reset()
for _ in range(50):
action, _ = model.predict(obs, deterministic=True)
obs, reward, done, info = env.step(action)
- Downloads last month
- 42
Papers for elliemci/tqc-PandaPickAndPlace-v3
Hindsight Experience Replay
Evaluation results
- mean_reward on PandaPickAndPlace-v3self-reported-30.86 +/- 21.70
- success_rate on PandaPickAndPlace-v3self-reported44.20

