Robotics
LeRobot
Safetensors
diffusion
masondx commited on
Commit
c01779d
·
verified ·
1 Parent(s): 1002684

Upload model card and train config

Browse files
Files changed (2) hide show
  1. README.md +162 -0
  2. train_config.json +287 -0
README.md ADDED
@@ -0,0 +1,162 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ datasets: lerobot/aloha_sim_transfer_cube_human
3
+ library_name: lerobot
4
+ license: apache-2.0
5
+ model_name: diffusion
6
+ pipeline_tag: robotics
7
+ tags:
8
+ - lerobot
9
+ - diffusion
10
+ - robotics
11
+ ---
12
+
13
+ # Model Card for diffusion
14
+
15
+ <!-- Provide a quick summary of what the model is/does. -->
16
+
17
+
18
+ [Diffusion Policy](https://huggingface.co/papers/2303.04137) treats visuomotor control as a generative diffusion process, producing smooth, multi-step action trajectories that excel at contact-rich manipulation.
19
+
20
+
21
+
22
+
23
+ <!-- A short demo is worth more than any description! Record a GIF/video of the policy
24
+ running on your robot, upload it to this repo, and embed it here:
25
+ <p align="center">
26
+ <img src="https://huggingface.co/<hf_user>/<policy_repo_id>/resolve/main/demo.gif" width="60%"/>
27
+ </p>
28
+ -->
29
+
30
+ This policy has been trained and pushed to the Hub using [LeRobot](https://github.com/huggingface/lerobot).
31
+
32
+ See the [full LeRobot documentation](https://huggingface.co/docs/lerobot/index).
33
+
34
+
35
+ ---
36
+
37
+ ## Model Details
38
+
39
+ - **License:** apache-2.0
40
+ - **Robot type:** `aloha`
41
+ - **Cameras:** `top`
42
+
43
+
44
+ ## Inputs & Outputs
45
+
46
+ The policy consumes these observation features and produces these action features.
47
+
48
+ **Inputs**
49
+
50
+ | Feature | Type | Shape |
51
+ | --- | --- | --- |
52
+ | `observation.images.top` | VISUAL | `(3, 480, 640)` |
53
+ | `observation.state` | STATE | `(14,)` |
54
+
55
+ **Outputs**
56
+
57
+ | Feature | Type | Shape |
58
+ | --- | --- | --- |
59
+ | `action` | ACTION | `(14,)` |
60
+
61
+
62
+ ## Training Dataset
63
+
64
+ - **Repository:** [lerobot/aloha_sim_transfer_cube_human](https://huggingface.co/datasets/lerobot/aloha_sim_transfer_cube_human)
65
+ - **Episodes:** 50
66
+ - **Frames:** 20000
67
+ - **Frame rate:** 50 FPS
68
+ - **Task(s):** "Pick up the cube with the right arm and transfer it to the left arm."
69
+
70
+ <a class="flex" href="https://huggingface.co/spaces/lerobot/visualize_dataset?path=lerobot/aloha_sim_transfer_cube_human">
71
+ <img class="block dark:hidden" src="https://huggingface.co/datasets/huggingface/badges/resolve/main/visualize-this-dataset-xl.svg"/>
72
+ <img class="hidden dark:block" src="https://huggingface.co/datasets/huggingface/badges/resolve/main/visualize-this-dataset-xl-dark.svg"/>
73
+ </a>
74
+
75
+
76
+ ## Training Configuration
77
+
78
+ | Setting | Value |
79
+ | --- | --- |
80
+ | Training steps | 100000 |
81
+ | Batch size | 8 |
82
+ | Optimizer | adam |
83
+ | Learning rate | 0.0001 |
84
+ | Seed | 1000 |
85
+ | LeRobot version | 0.6.2 |
86
+
87
+ ---
88
+
89
+ ## How to Get Started with the Model
90
+
91
+ New to LeRobot? These guides cover the full workflow:
92
+
93
+ - **[Install LeRobot](https://huggingface.co/docs/lerobot/main/en/installation)** — set up the `lerobot` package.
94
+ - **[Hardware setup](https://huggingface.co/docs/lerobot/main/en/hardware_guide)** — assemble, wire, and calibrate your robot and cameras.
95
+ - **[Record data & train a policy](https://huggingface.co/docs/lerobot/en/il_robots)** — the end-to-end imitation-learning walkthrough.
96
+ - **[CLI cheat-sheet](https://huggingface.co/docs/lerobot/main/en/cheat-sheet)** — quick reference for the `lerobot-*` commands.
97
+
98
+ The short version to run and train this policy:
99
+
100
+ ### Run the policy on your robot
101
+
102
+ ```bash
103
+ lerobot-rollout \
104
+ --strategy.type=base \
105
+ --robot.type=aloha \
106
+ --robot.port=<your_robot_port> \
107
+ --robot.cameras="{ <camera_1>: {type: opencv, index_or_path: <index_or_path>, width: 640, height: 480, fps: 30}, <camera_2>: {type: opencv, index_or_path: <index_or_path>, width: 640, height: 480, fps: 30}}" \
108
+ --policy.path=masondx/diffusion_aloha_sim_transfer_cube-ema \
109
+ --task="Pick up the cube with the right arm and transfer it to the left arm." \
110
+ --duration=60
111
+ ```
112
+
113
+ Replace the remaining `<...>` placeholders with your own values: `--robot.port` and the camera names/indices are specific to your machine, and the camera names must match the observation keys this policy was trained on.
114
+
115
+ When `--strategy.type=base` is used the script doesn't record the episodes. Skipping duration will make the policy run indefinitely. For more information look at [rollout documentation](https://huggingface.co/docs/lerobot/main/en/inference).
116
+
117
+ ### Train your own policy
118
+
119
+ ```bash
120
+ lerobot-train \
121
+ --dataset.repo_id=${HF_USER}/<dataset> \
122
+ --policy.type=diffusion \
123
+ --output_dir=outputs/train/<policy_repo_id> \
124
+ --job_name=lerobot_training \
125
+ --policy.device=cuda \
126
+ --policy.repo_id=${HF_USER}/<policy_repo_id> \
127
+ --wandb.enable=true
128
+ ```
129
+
130
+ _Writes checkpoints to `outputs/train/<policy_repo_id>/checkpoints/`._
131
+
132
+ ---
133
+
134
+ ## Evaluation
135
+
136
+ <!-- Report real-robot results here: run the policy several times per task and count the
137
+ successes. Delete the "No evaluation results" line and fill in this table instead:
138
+
139
+ | Task | Trials | Successes | Success rate |
140
+ | ---- | ------ | --------- | ------------ |
141
+ | pick the lego brick | 10 | 8 | 80% |
142
+
143
+ Also worth noting: anything that affects difficulty (new object positions, lighting,
144
+ distractors, a different robot of the same type, ...).
145
+ -->
146
+
147
+ _No evaluation results have been provided for this policy yet._
148
+
149
+ ---
150
+
151
+ ## Citation
152
+
153
+ If you use this policy, please cite the method linked in the description above, along with LeRobot:
154
+
155
+ ```bibtex
156
+ @misc{cadene2024lerobot,
157
+ author = {Cadene, Remi and Alibert, Simon and Soare, Alexander and Gallouedec, Quentin and Zouitine, Adil and Palma, Steven and Kooijmans, Pepijn and Aractingi, Michel and Shukor, Mustafa and Aubakirova, Dana and Russi, Martino and Capuano, Francesco and Pascal, Caroline and Choghari, Jade and Moss, Jess and Wolf, Thomas},
158
+ title = {LeRobot: State-of-the-art Machine Learning for Real-World Robotics in Pytorch},
159
+ howpublished = "\url{https://github.com/huggingface/lerobot}",
160
+ year = {2024}
161
+ }
162
+ ```
train_config.json ADDED
@@ -0,0 +1,287 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "dataset": {
3
+ "repo_id": "lerobot/aloha_sim_transfer_cube_human",
4
+ "repo_type": "dataset",
5
+ "root": null,
6
+ "episodes": null,
7
+ "exclude_episodes": null,
8
+ "image_transforms": {
9
+ "enable": false,
10
+ "max_num_transforms": 3,
11
+ "random_order": false,
12
+ "tfs": {
13
+ "brightness": {
14
+ "weight": 1.0,
15
+ "type": "ColorJitter",
16
+ "kwargs": {
17
+ "brightness": [
18
+ 0.8,
19
+ 1.2
20
+ ]
21
+ }
22
+ },
23
+ "contrast": {
24
+ "weight": 1.0,
25
+ "type": "ColorJitter",
26
+ "kwargs": {
27
+ "contrast": [
28
+ 0.8,
29
+ 1.2
30
+ ]
31
+ }
32
+ },
33
+ "saturation": {
34
+ "weight": 1.0,
35
+ "type": "ColorJitter",
36
+ "kwargs": {
37
+ "saturation": [
38
+ 0.5,
39
+ 1.5
40
+ ]
41
+ }
42
+ },
43
+ "hue": {
44
+ "weight": 1.0,
45
+ "type": "ColorJitter",
46
+ "kwargs": {
47
+ "hue": [
48
+ -0.05,
49
+ 0.05
50
+ ]
51
+ }
52
+ },
53
+ "sharpness": {
54
+ "weight": 1.0,
55
+ "type": "SharpnessJitter",
56
+ "kwargs": {
57
+ "sharpness": [
58
+ 0.5,
59
+ 1.5
60
+ ]
61
+ }
62
+ },
63
+ "affine": {
64
+ "weight": 1.0,
65
+ "type": "RandomAffine",
66
+ "kwargs": {
67
+ "degrees": [
68
+ -5.0,
69
+ 5.0
70
+ ],
71
+ "translate": [
72
+ 0.05,
73
+ 0.05
74
+ ]
75
+ }
76
+ }
77
+ }
78
+ },
79
+ "revision": null,
80
+ "use_imagenet_stats": true,
81
+ "video_backend": "pyav",
82
+ "return_uint8": false,
83
+ "depth_output_unit": "mm",
84
+ "streaming": false,
85
+ "eval_split": 0.0
86
+ },
87
+ "env": null,
88
+ "policy": {
89
+ "type": "diffusion",
90
+ "n_obs_steps": 2,
91
+ "input_features": {
92
+ "observation.images.top": {
93
+ "type": "VISUAL",
94
+ "shape": [
95
+ 3,
96
+ 480,
97
+ 640
98
+ ]
99
+ },
100
+ "observation.state": {
101
+ "type": "STATE",
102
+ "shape": [
103
+ 14
104
+ ]
105
+ }
106
+ },
107
+ "output_features": {
108
+ "action": {
109
+ "type": "ACTION",
110
+ "shape": [
111
+ 14
112
+ ]
113
+ }
114
+ },
115
+ "device": "cuda",
116
+ "use_amp": false,
117
+ "use_peft": false,
118
+ "push_to_hub": true,
119
+ "repo_id": "masondx/diffusion_aloha_sim_transfer_cube-ema",
120
+ "private": false,
121
+ "tags": null,
122
+ "license": null,
123
+ "pretrained_path": null,
124
+ "pretrained_revision": null,
125
+ "horizon": 64,
126
+ "n_action_steps": 32,
127
+ "normalization_mapping": {
128
+ "VISUAL": "MEAN_STD",
129
+ "STATE": "MIN_MAX",
130
+ "ACTION": "MIN_MAX"
131
+ },
132
+ "drop_n_last_frames": 7,
133
+ "vision_backbone": "resnet18",
134
+ "resize_shape": null,
135
+ "crop_ratio": 1.0,
136
+ "crop_shape": null,
137
+ "crop_is_random": true,
138
+ "pretrained_backbone_weights": "ResNet18_Weights.IMAGENET1K_V1",
139
+ "use_group_norm": false,
140
+ "spatial_softmax_num_keypoints": 32,
141
+ "use_separate_rgb_encoder_per_camera": true,
142
+ "down_dims": [
143
+ 512,
144
+ 1024,
145
+ 2048
146
+ ],
147
+ "kernel_size": 5,
148
+ "n_groups": 8,
149
+ "diffusion_step_embed_dim": 128,
150
+ "use_film_scale_modulation": true,
151
+ "gradient_checkpointing": false,
152
+ "noise_scheduler_type": "DDPM",
153
+ "num_train_timesteps": 100,
154
+ "beta_schedule": "squaredcos_cap_v2",
155
+ "beta_start": 0.0001,
156
+ "beta_end": 0.02,
157
+ "prediction_type": "epsilon",
158
+ "clip_sample": true,
159
+ "clip_sample_range": 1.0,
160
+ "num_inference_steps": null,
161
+ "compile_model": false,
162
+ "compile_mode": "reduce-overhead",
163
+ "do_mask_loss_for_padding": false,
164
+ "optimizer_lr": 0.0001,
165
+ "optimizer_betas": [
166
+ 0.95,
167
+ 0.999
168
+ ],
169
+ "optimizer_eps": 1e-08,
170
+ "optimizer_weight_decay": 1e-06,
171
+ "scheduler_name": "cosine",
172
+ "scheduler_warmup_steps": 500
173
+ },
174
+ "reward_model": null,
175
+ "output_dir": "outputs/train/diffusion_aloha_transfer_cube_100k",
176
+ "job_name": "diffusion_aloha_transfer_cube_100k",
177
+ "resume": false,
178
+ "seed": 1000,
179
+ "cudnn_deterministic": false,
180
+ "num_workers": 8,
181
+ "batch_size": 8,
182
+ "prefetch_factor": 4,
183
+ "persistent_workers": true,
184
+ "dataloader_multiprocessing_context": "spawn",
185
+ "steps": 100000,
186
+ "env_eval_freq": 0,
187
+ "log_freq": 200,
188
+ "eval_steps": 0,
189
+ "max_eval_samples": 0,
190
+ "tolerance_s": 0.0001,
191
+ "save_checkpoint": true,
192
+ "save_freq": 20000,
193
+ "checkpoint_format": "safetensors",
194
+ "use_policy_training_preset": true,
195
+ "optimizer": {
196
+ "type": "adam",
197
+ "lr": 0.0001,
198
+ "weight_decay": 1e-06,
199
+ "grad_clip_norm": 10.0,
200
+ "betas": [
201
+ 0.95,
202
+ 0.999
203
+ ],
204
+ "eps": 1e-08
205
+ },
206
+ "scheduler": {
207
+ "type": "diffuser",
208
+ "num_warmup_steps": 500,
209
+ "name": "cosine"
210
+ },
211
+ "parallelism": {
212
+ "dp_replicate": 1,
213
+ "dp_shard": 1,
214
+ "context_parallel": {
215
+ "ring_degree": 1,
216
+ "ulysses_degree": 1
217
+ },
218
+ "cfg_parallel": 1
219
+ },
220
+ "accelerator": {
221
+ "mixed_precision": "no",
222
+ "gradient_accumulation": {
223
+ "steps": 1
224
+ },
225
+ "fsdp": {
226
+ "reshard_after_forward": true,
227
+ "wrap_modules": null,
228
+ "min_num_params": null,
229
+ "cpu_offload": false,
230
+ "ignored_modules": null
231
+ },
232
+ "ddp": {
233
+ "find_unused_parameters": true,
234
+ "gradient_as_bucket_view": false,
235
+ "static_graph": false
236
+ },
237
+ "compile": {
238
+ "enabled": false,
239
+ "backend": "inductor",
240
+ "mode": null,
241
+ "regional": true
242
+ },
243
+ "activation_checkpointing": {
244
+ "mode": "none"
245
+ }
246
+ },
247
+ "eval": {
248
+ "n_episodes": 50,
249
+ "batch_size": 22,
250
+ "use_async_envs": true,
251
+ "recording": false,
252
+ "recording_repo_id": null,
253
+ "recording_private": false
254
+ },
255
+ "ema": {
256
+ "enable": true,
257
+ "decay": null,
258
+ "update_after_step": 0,
259
+ "inv_gamma": 1.0,
260
+ "power": 0.75,
261
+ "min_decay": 0.0,
262
+ "max_decay": 0.9999,
263
+ "use_for_eval": true
264
+ },
265
+ "wandb": {
266
+ "enable": false,
267
+ "disable_artifact": false,
268
+ "project": "lerobot",
269
+ "entity": null,
270
+ "notes": null,
271
+ "run_id": null,
272
+ "mode": null,
273
+ "add_tags": true
274
+ },
275
+ "peft": null,
276
+ "job": {
277
+ "target": null,
278
+ "image": "huggingface/lerobot-gpu:latest",
279
+ "timeout": "2d",
280
+ "detach": false,
281
+ "tags": []
282
+ },
283
+ "save_checkpoint_to_hub": false,
284
+ "sample_weighting": null,
285
+ "rename_map": {},
286
+ "checkpoint_path": null
287
+ }