Robotics
LeRobot
Safetensors
diffusion
miplayer commited on
Commit
e52dd3a
·
verified ·
1 Parent(s): ec5d7a2

Upload model card and train config

Browse files
Files changed (2) hide show
  1. README.md +162 -0
  2. train_config.json +382 -0
README.md ADDED
@@ -0,0 +1,162 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ datasets: loopwatt/loopwatt_peg_clean
3
+ library_name: lerobot
4
+ model_name: diffusion
5
+ pipeline_tag: robotics
6
+ tags:
7
+ - robotics
8
+ - diffusion
9
+ - lerobot
10
+ ---
11
+
12
+ # Model Card for diffusion
13
+
14
+ <!-- Provide a quick summary of what the model is/does. -->
15
+
16
+
17
+ [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.
18
+
19
+
20
+
21
+
22
+ <!-- A short demo is worth more than any description! Record a GIF/video of the policy
23
+ running on your robot, upload it to this repo, and embed it here:
24
+ <p align="center">
25
+ <img src="https://huggingface.co/<hf_user>/<policy_repo_id>/resolve/main/demo.gif" width="60%"/>
26
+ </p>
27
+ -->
28
+
29
+ This policy has been trained and pushed to the Hub using [LeRobot](https://github.com/huggingface/lerobot).
30
+
31
+ See the [full LeRobot documentation](https://huggingface.co/docs/lerobot/index).
32
+
33
+
34
+ ---
35
+
36
+ ## Model Details
37
+
38
+ - **License:** \[More Information Needed]
39
+ - **Robot type:** `so_follower`
40
+ - **Cameras:** `front`, `wrist`
41
+
42
+
43
+ ## Inputs & Outputs
44
+
45
+ The policy consumes these observation features and produces these action features.
46
+
47
+ **Inputs**
48
+
49
+ | Feature | Type | Shape |
50
+ | --- | --- | --- |
51
+ | `observation.state` | STATE | `(6,)` |
52
+ | `observation.images.front` | VISUAL | `(3, 480, 640)` |
53
+ | `observation.images.wrist` | VISUAL | `(3, 480, 640)` |
54
+
55
+ **Outputs**
56
+
57
+ | Feature | Type | Shape |
58
+ | --- | --- | --- |
59
+ | `action` | ACTION | `(6,)` |
60
+
61
+
62
+ ## Training Dataset
63
+
64
+ - **Repository:** [loopwatt/loopwatt_peg_clean](https://huggingface.co/datasets/loopwatt/loopwatt_peg_clean)
65
+ - **Episodes:** 65
66
+ - **Frames:** 33887
67
+ - **Frame rate:** 30 FPS
68
+ - **Task(s):** "Pick up the peg and insert it into the hole"
69
+
70
+ <a class="flex" href="https://huggingface.co/spaces/lerobot/visualize_dataset?path=loopwatt/loopwatt_peg_clean">
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 | 30000 |
81
+ | Batch size | 64 |
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=so_follower \
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=loopwatt/loopwatt_peg_diffusion_h64 \
109
+ --task="Pick up the peg and insert it into the hole" \
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,382 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "dataset": {
3
+ "repo_id": "loopwatt/loopwatt_peg_clean",
4
+ "repo_type": "dataset",
5
+ "root": null,
6
+ "episodes": [
7
+ 0,
8
+ 1,
9
+ 2,
10
+ 3,
11
+ 5,
12
+ 6,
13
+ 7,
14
+ 8,
15
+ 9,
16
+ 10,
17
+ 11,
18
+ 12,
19
+ 13,
20
+ 14,
21
+ 15,
22
+ 16,
23
+ 18,
24
+ 19,
25
+ 20,
26
+ 21,
27
+ 22,
28
+ 23,
29
+ 24,
30
+ 25,
31
+ 26,
32
+ 27,
33
+ 28,
34
+ 29,
35
+ 31,
36
+ 32,
37
+ 33,
38
+ 34,
39
+ 35,
40
+ 36,
41
+ 37,
42
+ 38,
43
+ 39,
44
+ 40,
45
+ 41,
46
+ 42,
47
+ 44,
48
+ 45,
49
+ 46,
50
+ 47,
51
+ 48,
52
+ 49,
53
+ 50,
54
+ 51,
55
+ 52,
56
+ 53,
57
+ 54,
58
+ 55,
59
+ 57,
60
+ 58,
61
+ 59,
62
+ 60,
63
+ 61,
64
+ 62,
65
+ 63,
66
+ 64
67
+ ],
68
+ "exclude_episodes": null,
69
+ "image_transforms": {
70
+ "enable": false,
71
+ "backend": "dataloader",
72
+ "gpu_compile": true,
73
+ "gpu_chunk_size": 32,
74
+ "max_num_transforms": 3,
75
+ "random_order": false,
76
+ "tfs": {
77
+ "brightness": {
78
+ "weight": 1.0,
79
+ "type": "ColorJitter",
80
+ "kwargs": {
81
+ "brightness": [
82
+ 0.8,
83
+ 1.2
84
+ ]
85
+ }
86
+ },
87
+ "contrast": {
88
+ "weight": 1.0,
89
+ "type": "ColorJitter",
90
+ "kwargs": {
91
+ "contrast": [
92
+ 0.8,
93
+ 1.2
94
+ ]
95
+ }
96
+ },
97
+ "saturation": {
98
+ "weight": 1.0,
99
+ "type": "ColorJitter",
100
+ "kwargs": {
101
+ "saturation": [
102
+ 0.5,
103
+ 1.5
104
+ ]
105
+ }
106
+ },
107
+ "hue": {
108
+ "weight": 1.0,
109
+ "type": "ColorJitter",
110
+ "kwargs": {
111
+ "hue": [
112
+ -0.05,
113
+ 0.05
114
+ ]
115
+ }
116
+ },
117
+ "sharpness": {
118
+ "weight": 1.0,
119
+ "type": "SharpnessJitter",
120
+ "kwargs": {
121
+ "sharpness": [
122
+ 0.5,
123
+ 1.5
124
+ ]
125
+ }
126
+ },
127
+ "affine": {
128
+ "weight": 1.0,
129
+ "type": "RandomAffine",
130
+ "kwargs": {
131
+ "degrees": [
132
+ -5.0,
133
+ 5.0
134
+ ],
135
+ "translate": [
136
+ 0.05,
137
+ 0.05
138
+ ]
139
+ }
140
+ }
141
+ }
142
+ },
143
+ "revision": null,
144
+ "use_imagenet_stats": true,
145
+ "video_backend": "pyav",
146
+ "return_uint8": false,
147
+ "depth_output_unit": "mm",
148
+ "streaming": false,
149
+ "streaming_episode_pool_size": null,
150
+ "streaming_sampling_strategy": "remaining",
151
+ "streaming_prefetch_episodes": 8,
152
+ "streaming_byte_budget_gb": 8.0,
153
+ "streaming_decode_threads": 2,
154
+ "streaming_decoded_queue_size": 8,
155
+ "streaming_native_http_connections": null,
156
+ "streaming_native_http_subranges": 1,
157
+ "video_decoder_cache_size": null,
158
+ "eval_split": 0.0
159
+ },
160
+ "env": null,
161
+ "policy": {
162
+ "type": "diffusion",
163
+ "n_obs_steps": 2,
164
+ "input_features": {
165
+ "observation.state": {
166
+ "type": "STATE",
167
+ "shape": [
168
+ 6
169
+ ]
170
+ },
171
+ "observation.images.front": {
172
+ "type": "VISUAL",
173
+ "shape": [
174
+ 3,
175
+ 480,
176
+ 640
177
+ ]
178
+ },
179
+ "observation.images.wrist": {
180
+ "type": "VISUAL",
181
+ "shape": [
182
+ 3,
183
+ 480,
184
+ 640
185
+ ]
186
+ }
187
+ },
188
+ "output_features": {
189
+ "action": {
190
+ "type": "ACTION",
191
+ "shape": [
192
+ 6
193
+ ]
194
+ }
195
+ },
196
+ "device": "cuda",
197
+ "dtype": null,
198
+ "use_amp": false,
199
+ "use_peft": false,
200
+ "push_to_hub": true,
201
+ "repo_id": "loopwatt/loopwatt_peg_diffusion_h64",
202
+ "private": null,
203
+ "tags": null,
204
+ "license": null,
205
+ "pretrained_path": null,
206
+ "pretrained_revision": null,
207
+ "horizon": 64,
208
+ "n_action_steps": 16,
209
+ "normalization_mapping": {
210
+ "VISUAL": "MEAN_STD",
211
+ "STATE": "MIN_MAX",
212
+ "ACTION": "MIN_MAX"
213
+ },
214
+ "drop_n_last_frames": 47,
215
+ "vision_backbone": "resnet18",
216
+ "resize_shape": null,
217
+ "crop_ratio": 1.0,
218
+ "crop_shape": [
219
+ 432,
220
+ 576
221
+ ],
222
+ "crop_is_random": true,
223
+ "pretrained_backbone_weights": "ResNet18_Weights.IMAGENET1K_V1",
224
+ "use_group_norm": false,
225
+ "spatial_softmax_num_keypoints": 32,
226
+ "use_separate_rgb_encoder_per_camera": true,
227
+ "down_dims": [
228
+ 512,
229
+ 1024,
230
+ 2048
231
+ ],
232
+ "kernel_size": 5,
233
+ "n_groups": 8,
234
+ "diffusion_step_embed_dim": 128,
235
+ "use_film_scale_modulation": true,
236
+ "gradient_checkpointing": false,
237
+ "noise_scheduler_type": "DDIM",
238
+ "num_train_timesteps": 100,
239
+ "beta_schedule": "squaredcos_cap_v2",
240
+ "beta_start": 0.0001,
241
+ "beta_end": 0.02,
242
+ "prediction_type": "epsilon",
243
+ "clip_sample": true,
244
+ "clip_sample_range": 1.0,
245
+ "num_inference_steps": 16,
246
+ "compile_model": false,
247
+ "compile_mode": "reduce-overhead",
248
+ "do_mask_loss_for_padding": false,
249
+ "optimizer_lr": 0.0001,
250
+ "optimizer_betas": [
251
+ 0.95,
252
+ 0.999
253
+ ],
254
+ "optimizer_eps": 1e-08,
255
+ "optimizer_weight_decay": 1e-06,
256
+ "scheduler_name": "cosine",
257
+ "scheduler_warmup_steps": 500
258
+ },
259
+ "reward_model": null,
260
+ "output_dir": "/workspace/outputs/train/diffusion_h64",
261
+ "job_name": "diffusion",
262
+ "resume": false,
263
+ "seed": 1000,
264
+ "cudnn_deterministic": false,
265
+ "num_workers": 4,
266
+ "batch_size": 64,
267
+ "prefetch_factor": 4,
268
+ "persistent_workers": true,
269
+ "dataloader_multiprocessing_context": "spawn",
270
+ "steps": 30000,
271
+ "env_eval_freq": 20000,
272
+ "log_freq": 200,
273
+ "eval_steps": 0,
274
+ "max_eval_samples": 0,
275
+ "tolerance_s": 0.0001,
276
+ "save_checkpoint": true,
277
+ "save_freq": 20000,
278
+ "checkpoint_format": "safetensors",
279
+ "use_policy_training_preset": true,
280
+ "optimizer": {
281
+ "type": "adam",
282
+ "lr": 0.0001,
283
+ "weight_decay": 1e-06,
284
+ "grad_clip_norm": 10.0,
285
+ "betas": [
286
+ 0.95,
287
+ 0.999
288
+ ],
289
+ "eps": 1e-08
290
+ },
291
+ "scheduler": {
292
+ "type": "diffuser",
293
+ "num_warmup_steps": 500,
294
+ "name": "cosine"
295
+ },
296
+ "parallelism": {
297
+ "dp_replicate": 1,
298
+ "dp_shard": 1,
299
+ "context_parallel": {
300
+ "ring_degree": 1,
301
+ "ulysses_degree": 1
302
+ },
303
+ "cfg_parallel": 1
304
+ },
305
+ "accelerator": {
306
+ "mixed_precision": "bf16",
307
+ "gradient_accumulation": {
308
+ "steps": 1
309
+ },
310
+ "grad_scaler": {
311
+ "init_scale": 65536.0,
312
+ "growth_factor": 2.0,
313
+ "backoff_factor": 0.5,
314
+ "growth_interval": 2000
315
+ },
316
+ "fsdp": {
317
+ "reshard_after_forward": true,
318
+ "wrap_modules": null,
319
+ "min_num_params": null,
320
+ "cpu_offload": false,
321
+ "ignored_modules": null
322
+ },
323
+ "ddp": {
324
+ "find_unused_parameters": true,
325
+ "gradient_as_bucket_view": false,
326
+ "static_graph": false
327
+ },
328
+ "compile": {
329
+ "enabled": false,
330
+ "backend": "inductor",
331
+ "mode": null,
332
+ "regional": true
333
+ },
334
+ "activation_checkpointing": {
335
+ "mode": "none"
336
+ }
337
+ },
338
+ "eval": {
339
+ "n_episodes": 50,
340
+ "batch_size": 50,
341
+ "use_async_envs": true,
342
+ "recording": false,
343
+ "recording_repo_id": null,
344
+ "recording_private": false
345
+ },
346
+ "ema": {
347
+ "enable": false,
348
+ "decay": null,
349
+ "update_after_step": 0,
350
+ "inv_gamma": 1.0,
351
+ "power": 0.75,
352
+ "min_decay": 0.0,
353
+ "max_decay": 0.9999,
354
+ "use_for_eval": true
355
+ },
356
+ "wandb": {
357
+ "enable": false,
358
+ "disable_artifact": false,
359
+ "project": "lerobot",
360
+ "entity": null,
361
+ "notes": null,
362
+ "run_id": null,
363
+ "resume": null,
364
+ "mode": null,
365
+ "console": "wrap",
366
+ "console_multipart": false,
367
+ "console_chunk_max_seconds": 0,
368
+ "add_tags": true
369
+ },
370
+ "peft": null,
371
+ "job": {
372
+ "target": null,
373
+ "image": "huggingface/lerobot-gpu:latest",
374
+ "timeout": "2d",
375
+ "detach": false,
376
+ "tags": []
377
+ },
378
+ "save_checkpoint_to_hub": true,
379
+ "sample_weighting": null,
380
+ "rename_map": {},
381
+ "checkpoint_path": null
382
+ }