Robotics
LeRobot
Safetensors
diffusion
marioguzzzman commited on
Commit
6744d85
·
verified ·
1 Parent(s): ca9c7af

Upload policy weights, train config and readme

Browse files
Files changed (4) hide show
  1. README.md +162 -0
  2. config.json +84 -0
  3. model.safetensors +3 -0
  4. train_config.json +261 -0
README.md ADDED
@@ -0,0 +1,162 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ datasets: lerobot/pusht
3
+ library_name: lerobot
4
+ license: apache-2.0
5
+ model_name: diffusion
6
+ pipeline_tag: robotics
7
+ tags:
8
+ - diffusion
9
+ - lerobot
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:** `unknown`
41
+ - **Cameras:** `image`
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.image` | VISUAL | `(3, 96, 96)` |
53
+ | `observation.state` | STATE | `(2,)` |
54
+
55
+ **Outputs**
56
+
57
+ | Feature | Type | Shape |
58
+ | --- | --- | --- |
59
+ | `action` | ACTION | `(2,)` |
60
+
61
+
62
+ ## Training Dataset
63
+
64
+ - **Repository:** [lerobot/pusht](https://huggingface.co/datasets/lerobot/pusht)
65
+ - **Episodes:** 206
66
+ - **Frames:** 25650
67
+ - **Frame rate:** 10 FPS
68
+ - **Task(s):** "Push the T-shaped block onto the T-shaped target."
69
+
70
+ <a class="flex" href="https://huggingface.co/spaces/lerobot/visualize_dataset?path=lerobot/pusht">
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.5.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=unknown \
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=marioguzzzman/my_pusht_diffusion \
109
+ --task="Push the T-shaped block onto the T-shaped target." \
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
+ ```
config.json ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "type": "diffusion",
3
+ "n_obs_steps": 2,
4
+ "input_features": {
5
+ "observation.image": {
6
+ "type": "VISUAL",
7
+ "shape": [
8
+ 3,
9
+ 96,
10
+ 96
11
+ ]
12
+ },
13
+ "observation.state": {
14
+ "type": "STATE",
15
+ "shape": [
16
+ 2
17
+ ]
18
+ }
19
+ },
20
+ "output_features": {
21
+ "action": {
22
+ "type": "ACTION",
23
+ "shape": [
24
+ 2
25
+ ]
26
+ }
27
+ },
28
+ "device": "cuda",
29
+ "use_amp": false,
30
+ "use_peft": false,
31
+ "push_to_hub": true,
32
+ "repo_id": "marioguzzzman/my_pusht_diffusion",
33
+ "private": null,
34
+ "tags": null,
35
+ "license": null,
36
+ "pretrained_path": null,
37
+ "horizon": 64,
38
+ "n_action_steps": 32,
39
+ "normalization_mapping": {
40
+ "VISUAL": "MEAN_STD",
41
+ "STATE": "MIN_MAX",
42
+ "ACTION": "MIN_MAX"
43
+ },
44
+ "drop_n_last_frames": 7,
45
+ "vision_backbone": "resnet18",
46
+ "resize_shape": null,
47
+ "crop_ratio": 1.0,
48
+ "crop_shape": null,
49
+ "crop_is_random": true,
50
+ "pretrained_backbone_weights": "ResNet18_Weights.IMAGENET1K_V1",
51
+ "use_group_norm": false,
52
+ "spatial_softmax_num_keypoints": 32,
53
+ "use_separate_rgb_encoder_per_camera": true,
54
+ "down_dims": [
55
+ 512,
56
+ 1024,
57
+ 2048
58
+ ],
59
+ "kernel_size": 5,
60
+ "n_groups": 8,
61
+ "diffusion_step_embed_dim": 128,
62
+ "use_film_scale_modulation": true,
63
+ "noise_scheduler_type": "DDPM",
64
+ "num_train_timesteps": 100,
65
+ "beta_schedule": "squaredcos_cap_v2",
66
+ "beta_start": 0.0001,
67
+ "beta_end": 0.02,
68
+ "prediction_type": "epsilon",
69
+ "clip_sample": true,
70
+ "clip_sample_range": 1.0,
71
+ "num_inference_steps": null,
72
+ "compile_model": false,
73
+ "compile_mode": "reduce-overhead",
74
+ "do_mask_loss_for_padding": false,
75
+ "optimizer_lr": 0.0001,
76
+ "optimizer_betas": [
77
+ 0.95,
78
+ 0.999
79
+ ],
80
+ "optimizer_eps": 1e-08,
81
+ "optimizer_weight_decay": 1e-06,
82
+ "scheduler_name": "cosine",
83
+ "scheduler_warmup_steps": 500
84
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ac8a813d7c23e61fda186041f4838766790c6c5916a3b0d4c2cc3af24f1cd6ce
3
+ size 1050907184
train_config.json ADDED
@@ -0,0 +1,261 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "dataset": {
3
+ "repo_id": "lerobot/pusht",
4
+ "root": null,
5
+ "episodes": null,
6
+ "image_transforms": {
7
+ "enable": false,
8
+ "max_num_transforms": 3,
9
+ "random_order": false,
10
+ "tfs": {
11
+ "brightness": {
12
+ "weight": 1.0,
13
+ "type": "ColorJitter",
14
+ "kwargs": {
15
+ "brightness": [
16
+ 0.8,
17
+ 1.2
18
+ ]
19
+ }
20
+ },
21
+ "contrast": {
22
+ "weight": 1.0,
23
+ "type": "ColorJitter",
24
+ "kwargs": {
25
+ "contrast": [
26
+ 0.8,
27
+ 1.2
28
+ ]
29
+ }
30
+ },
31
+ "saturation": {
32
+ "weight": 1.0,
33
+ "type": "ColorJitter",
34
+ "kwargs": {
35
+ "saturation": [
36
+ 0.5,
37
+ 1.5
38
+ ]
39
+ }
40
+ },
41
+ "hue": {
42
+ "weight": 1.0,
43
+ "type": "ColorJitter",
44
+ "kwargs": {
45
+ "hue": [
46
+ -0.05,
47
+ 0.05
48
+ ]
49
+ }
50
+ },
51
+ "sharpness": {
52
+ "weight": 1.0,
53
+ "type": "SharpnessJitter",
54
+ "kwargs": {
55
+ "sharpness": [
56
+ 0.5,
57
+ 1.5
58
+ ]
59
+ }
60
+ },
61
+ "affine": {
62
+ "weight": 1.0,
63
+ "type": "RandomAffine",
64
+ "kwargs": {
65
+ "degrees": [
66
+ -5.0,
67
+ 5.0
68
+ ],
69
+ "translate": [
70
+ 0.05,
71
+ 0.05
72
+ ]
73
+ }
74
+ }
75
+ }
76
+ },
77
+ "revision": null,
78
+ "use_imagenet_stats": true,
79
+ "video_backend": "torchcodec",
80
+ "return_uint8": false,
81
+ "streaming": false
82
+ },
83
+ "env": {
84
+ "type": "pusht",
85
+ "task": "PushT-v0",
86
+ "fps": 10,
87
+ "features": {
88
+ "action": {
89
+ "type": "ACTION",
90
+ "shape": [
91
+ 2
92
+ ]
93
+ },
94
+ "agent_pos": {
95
+ "type": "STATE",
96
+ "shape": [
97
+ 2
98
+ ]
99
+ },
100
+ "pixels": {
101
+ "type": "VISUAL",
102
+ "shape": [
103
+ 384,
104
+ 384,
105
+ 3
106
+ ]
107
+ }
108
+ },
109
+ "features_map": {
110
+ "action": "action",
111
+ "agent_pos": "observation.state",
112
+ "environment_state": "observation.environment_state",
113
+ "pixels": "observation.image"
114
+ },
115
+ "max_parallel_tasks": 1,
116
+ "disable_env_checker": true,
117
+ "episode_length": 300,
118
+ "obs_type": "pixels_agent_pos",
119
+ "render_mode": "rgb_array",
120
+ "visualization_width": 384,
121
+ "visualization_height": 384,
122
+ "observation_height": 384,
123
+ "observation_width": 384
124
+ },
125
+ "policy": {
126
+ "type": "diffusion",
127
+ "n_obs_steps": 2,
128
+ "input_features": {
129
+ "observation.image": {
130
+ "type": "VISUAL",
131
+ "shape": [
132
+ 3,
133
+ 96,
134
+ 96
135
+ ]
136
+ },
137
+ "observation.state": {
138
+ "type": "STATE",
139
+ "shape": [
140
+ 2
141
+ ]
142
+ }
143
+ },
144
+ "output_features": {
145
+ "action": {
146
+ "type": "ACTION",
147
+ "shape": [
148
+ 2
149
+ ]
150
+ }
151
+ },
152
+ "device": "cuda",
153
+ "use_amp": false,
154
+ "use_peft": false,
155
+ "push_to_hub": true,
156
+ "repo_id": "marioguzzzman/my_pusht_diffusion",
157
+ "private": null,
158
+ "tags": null,
159
+ "license": null,
160
+ "pretrained_path": null,
161
+ "horizon": 64,
162
+ "n_action_steps": 32,
163
+ "normalization_mapping": {
164
+ "VISUAL": "MEAN_STD",
165
+ "STATE": "MIN_MAX",
166
+ "ACTION": "MIN_MAX"
167
+ },
168
+ "drop_n_last_frames": 7,
169
+ "vision_backbone": "resnet18",
170
+ "resize_shape": null,
171
+ "crop_ratio": 1.0,
172
+ "crop_shape": null,
173
+ "crop_is_random": true,
174
+ "pretrained_backbone_weights": "ResNet18_Weights.IMAGENET1K_V1",
175
+ "use_group_norm": false,
176
+ "spatial_softmax_num_keypoints": 32,
177
+ "use_separate_rgb_encoder_per_camera": true,
178
+ "down_dims": [
179
+ 512,
180
+ 1024,
181
+ 2048
182
+ ],
183
+ "kernel_size": 5,
184
+ "n_groups": 8,
185
+ "diffusion_step_embed_dim": 128,
186
+ "use_film_scale_modulation": true,
187
+ "noise_scheduler_type": "DDPM",
188
+ "num_train_timesteps": 100,
189
+ "beta_schedule": "squaredcos_cap_v2",
190
+ "beta_start": 0.0001,
191
+ "beta_end": 0.02,
192
+ "prediction_type": "epsilon",
193
+ "clip_sample": true,
194
+ "clip_sample_range": 1.0,
195
+ "num_inference_steps": null,
196
+ "compile_model": false,
197
+ "compile_mode": "reduce-overhead",
198
+ "do_mask_loss_for_padding": false,
199
+ "optimizer_lr": 0.0001,
200
+ "optimizer_betas": [
201
+ 0.95,
202
+ 0.999
203
+ ],
204
+ "optimizer_eps": 1e-08,
205
+ "optimizer_weight_decay": 1e-06,
206
+ "scheduler_name": "cosine",
207
+ "scheduler_warmup_steps": 500
208
+ },
209
+ "reward_model": null,
210
+ "output_dir": "outputs/train/my_pusht_diffusion",
211
+ "job_name": "my_pusht_diffusion",
212
+ "resume": false,
213
+ "seed": 1000,
214
+ "cudnn_deterministic": false,
215
+ "num_workers": 4,
216
+ "batch_size": 8,
217
+ "prefetch_factor": 4,
218
+ "persistent_workers": true,
219
+ "steps": 100000,
220
+ "eval_freq": 20000,
221
+ "log_freq": 200,
222
+ "tolerance_s": 0.0001,
223
+ "save_checkpoint": true,
224
+ "save_freq": 20000,
225
+ "use_policy_training_preset": true,
226
+ "optimizer": {
227
+ "type": "adam",
228
+ "lr": 0.0001,
229
+ "weight_decay": 1e-06,
230
+ "grad_clip_norm": 10.0,
231
+ "betas": [
232
+ 0.95,
233
+ 0.999
234
+ ],
235
+ "eps": 1e-08
236
+ },
237
+ "scheduler": {
238
+ "type": "diffuser",
239
+ "num_warmup_steps": 500,
240
+ "name": "cosine"
241
+ },
242
+ "eval": {
243
+ "n_episodes": 50,
244
+ "batch_size": 16,
245
+ "use_async_envs": false
246
+ },
247
+ "wandb": {
248
+ "enable": false,
249
+ "disable_artifact": false,
250
+ "project": "lerobot",
251
+ "entity": null,
252
+ "notes": null,
253
+ "run_id": null,
254
+ "mode": null,
255
+ "add_tags": true
256
+ },
257
+ "peft": null,
258
+ "sample_weighting": null,
259
+ "rename_map": {},
260
+ "checkpoint_path": null
261
+ }