lerobot/pusht
Viewer • Updated • 25.7k • 13.6k • 58
How to use naonaon/smolvla_pusht with LeRobot:
# See https://github.com/huggingface/lerobot?tab=readme-ov-file#installation for more details git clone https://github.com/huggingface/lerobot.git cd lerobot pip install -e .[smolvla]
# Launch finetuning on your dataset python lerobot/scripts/train.py \ --policy.path=naonaon/smolvla_pusht \ --dataset.repo_id=lerobot/svla_so101_pickplace \ --batch_size=64 \ --steps=20000 \ --output_dir=outputs/train/my_smolvla \ --job_name=my_smolvla_training \ --policy.device=cuda \ --wandb.enable=true
# Run the policy using the record function
python -m lerobot.record \
--robot.type=so101_follower \
--robot.port=/dev/ttyACM0 \ # <- Use your port
--robot.id=my_blue_follower_arm \ # <- Use your robot id
--robot.cameras="{ front: {type: opencv, index_or_path: 8, width: 640, height: 480, fps: 30}}" \ # <- Use your cameras
--dataset.single_task="Grasp a lego block and put it in the bin." \ # <- Use the same task description you used in your dataset recording
--dataset.repo_id=HF_USER/dataset_name \ # <- This will be the dataset name on HF Hub
--dataset.episode_time_s=50 \
--dataset.num_episodes=10 \
--policy.path=naonaon/smolvla_pushtThis model is a fine-tuned version of lerobot/smolvla_base on the lerobot/pusht dataset.
Since smolvla_base was trained with 3 cameras and 6-dimensional actions, but PushT uses 1 camera and 2-dimensional actions, special options are required for both training and evaluation.
| Option | Description |
|---|---|
--policy.empty_cameras=2 |
Fill missing camera2 and camera3 with dummy images |
--rename_map='{"observation.image": "observation.images.camera1"}' |
Map PushT's camera to SmolVLA's expected format |
--policy.output_features='{"action": {"type": "ACTION", "shape": [2]}}' |
Required for evaluation: Override action dimension from 6 to 2 |
uv run lerobot-eval \
--policy.path=naonaon/smolvla_pusht \
--env.type=pusht \
--eval.n_episodes=50 \
--eval.batch_size=50 \
--policy.empty_cameras=2 \
--policy.output_features='{"action": {"type": "ACTION", "shape": [2]}}' \
--rename_map='{"observation.image": "observation.images.camera1"}'
TOKENIZERS_PARALLELISM=false uv run lerobot-train \
--policy.path=lerobot/smolvla_base \
--dataset.repo_id=lerobot/pusht \
--dataset.image_transforms.enable=false \
--batch_size=24 \
--steps=40000 \
--output_dir=outputs/pusht_smolvla_finetune \
--job_name=pusht_smolvla_finetune \
--policy.empty_cameras=2 \
--rename_map='{"observation.image": "observation.images.camera1"}'
| Step | Loss | Gradient Norm |
|---|---|---|
| 200 | 0.060 | 0.685 |
| 5,000 | 0.021 | 0.266 |
| 20,000 | 0.009 | 0.131 |
| 40,000 | 0.008 | 0.091 |
--policy.output_features override at evaluation timeIf you use this model, please cite the original SmolVLA paper:
@article{smolvla2024,
title={SmolVLA: A Small Vision-Language-Action Model for Efficient Robot Learning},
author={Hugging Face Team},
year={2024}
}
Base model
lerobot/smolvla_base