ChadSaglam commited on
Commit
c1192e7
·
verified ·
1 Parent(s): c17ee29

ACT on AlohaTransferCube, 80k steps, trained on Apple M4

Browse files
README.md ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: lerobot
3
+ license: mit
4
+ pipeline_tag: robotics
5
+ datasets:
6
+ - lerobot/aloha_sim_transfer_cube_human
7
+ tags:
8
+ - robotics
9
+ - lerobot
10
+ - act
11
+ - imitation-learning
12
+ - aloha
13
+ - simulation
14
+ model-index:
15
+ - name: act_aloha_sim_transfer_cube
16
+ results:
17
+ - task:
18
+ type: robotics
19
+ name: AlohaTransferCube-v0 (gym-aloha)
20
+ dataset:
21
+ type: lerobot/aloha_sim_transfer_cube_human
22
+ name: aloha_sim_transfer_cube_human
23
+ metrics:
24
+ - type: success_rate
25
+ value: 75.5
26
+ name: success rate over 200 episodes (95% Wilson CI 69.1-80.9)
27
+ ---
28
+
29
+ # ACT on ALOHA TransferCube, trained from scratch on an Apple M4 laptop
30
+
31
+ An [ACT](https://arxiv.org/abs/2304.13705) policy for the `AlohaTransferCube-v0` simulation task,
32
+ trained with [LeRobot](https://github.com/huggingface/lerobot) 0.7.0 on the
33
+ [`lerobot/aloha_sim_transfer_cube_human`](https://huggingface.co/datasets/lerobot/aloha_sim_transfer_cube_human)
34
+ dataset (50 human demonstrations). Training ran on an Apple M4 MacBook Pro (MPS, no NVIDIA GPU) for
35
+ 80k steps at batch size 8, about 10 hours in total. LeRobot's default ACT hyperparameters, nothing tuned.
36
+
37
+ Code, evaluation scripts, per-checkpoint results and training curves:
38
+ [github.com/ChadSaglam/lerobot-sim-transfer-cube](https://github.com/ChadSaglam/lerobot-sim-transfer-cube).
39
+
40
+ ## Evaluation
41
+
42
+ Same simulator, same episode seeds (`--seed=1000`), 200 episodes, 95% Wilson intervals from `lerobot-eval`.
43
+
44
+ | Policy | Training steps | Success | 95% CI |
45
+ |---|---|---|---|
46
+ | official [`lerobot/act_aloha_sim_transfer_cube_human`](https://huggingface.co/lerobot/act_aloha_sim_transfer_cube_human) | 80k | 81.0% (162/200) | 75.0-85.8 |
47
+ | **this model** (seed 1000) | 80k | **75.5%** (151/200) | 69.1-80.9 |
48
+ | same run at 50k steps | 50k | 64.0% (128/200) | 57.1-70.3 |
49
+ | second seed (1001) at 50k steps | 50k | 62.0% (124/200) | 55.1-68.4 |
50
+
51
+ The intervals of this model and the official checkpoint overlap; the two are statistically
52
+ indistinguishable at this sample size. The 50k checkpoints are clearly below the baseline.
53
+
54
+ Two things the per-checkpoint evaluations showed (details in the GitHub README):
55
+ the training loss is not a proxy for task success (two seeds with identical loss curves differed by
56
+ 34 points in success at 10k steps), and 50-episode evaluations cannot rank neighbouring checkpoints.
57
+
58
+ ## How to use
59
+
60
+ ```bash
61
+ pip install 'lerobot[aloha]==0.7.0'
62
+
63
+ lerobot-eval \
64
+ --policy.path=ChadSaglam/act_aloha_sim_transfer_cube \
65
+ --env.type=aloha \
66
+ --env.task=AlohaTransferCube-v0 \
67
+ --eval.n_episodes=200 \
68
+ --eval.batch_size=10 \
69
+ --seed=1000 \
70
+ --policy.device=cuda # mps on Apple Silicon; add --eval.use_async_envs=false on macOS
71
+ ```
72
+
73
+ ## Training
74
+
75
+ ```bash
76
+ lerobot-train \
77
+ --policy.type=act \
78
+ --policy.device=mps \
79
+ --policy.push_to_hub=false \
80
+ --dataset.repo_id=lerobot/aloha_sim_transfer_cube_human \
81
+ --env.type=aloha \
82
+ --env.task=AlohaTransferCube-v0 \
83
+ --env_eval_freq=0 \
84
+ --seed=1000 \
85
+ --steps=50000 \
86
+ --batch_size=8 \
87
+ --save_freq=10000 \
88
+ --output_dir=outputs/train/act_transfer_cube_seed1000
89
+ # then resumed from the 50k checkpoint with --resume=true --steps=80000
90
+ ```
91
+
92
+ - Policy: ACT, ResNet-18 backbone (ImageNet init), chunk size 100, 100 action steps, VAE on, KL weight 10,
93
+ AdamW, learning rate 1e-5, batch size 8. `train_config.json` in this repository has every setting.
94
+ - Throughput on the M4: 2.2 steps/s. 50k steps in 6 h 22 min, the 30k-step extension in 3 h 47 min.
95
+ - Checkpoint format: LeRobot 0.7.0 processor pipeline (`policy_preprocessor.json`, `policy_postprocessor.json`).
96
+
97
+ ## Limitations
98
+
99
+ - Simulation only; one task; one evaluation seed set. Another `--seed` would move every number by a few points.
100
+ - Success is the `gym-aloha` definition (cube lifted by the right arm and transferred to the left gripper).
101
+ - No hyperparameter tuning; LeRobot defaults throughout.
config.json ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "type": "act",
3
+ "n_obs_steps": 1,
4
+ "input_features": {
5
+ "observation.images.top": {
6
+ "type": "VISUAL",
7
+ "shape": [
8
+ 3,
9
+ 480,
10
+ 640
11
+ ]
12
+ },
13
+ "observation.state": {
14
+ "type": "STATE",
15
+ "shape": [
16
+ 14
17
+ ]
18
+ }
19
+ },
20
+ "output_features": {
21
+ "action": {
22
+ "type": "ACTION",
23
+ "shape": [
24
+ 14
25
+ ]
26
+ }
27
+ },
28
+ "device": "mps",
29
+ "dtype": null,
30
+ "use_amp": false,
31
+ "use_peft": false,
32
+ "push_to_hub": false,
33
+ "repo_id": null,
34
+ "private": null,
35
+ "tags": null,
36
+ "license": null,
37
+ "pretrained_path": null,
38
+ "pretrained_revision": null,
39
+ "chunk_size": 100,
40
+ "n_action_steps": 100,
41
+ "normalization_mapping": {
42
+ "VISUAL": "MEAN_STD",
43
+ "STATE": "MEAN_STD",
44
+ "ACTION": "MEAN_STD"
45
+ },
46
+ "vision_backbone": "resnet18",
47
+ "pretrained_backbone_weights": "ResNet18_Weights.IMAGENET1K_V1",
48
+ "replace_final_stride_with_dilation": 0,
49
+ "pre_norm": false,
50
+ "dim_model": 512,
51
+ "n_heads": 8,
52
+ "dim_feedforward": 3200,
53
+ "feedforward_activation": "relu",
54
+ "n_encoder_layers": 4,
55
+ "n_decoder_layers": 1,
56
+ "use_vae": true,
57
+ "latent_dim": 32,
58
+ "n_vae_encoder_layers": 4,
59
+ "temporal_ensemble_coeff": null,
60
+ "dropout": 0.1,
61
+ "kl_weight": 10.0,
62
+ "optimizer_lr": 1e-05,
63
+ "optimizer_weight_decay": 0.0001,
64
+ "optimizer_lr_backbone": 1e-05,
65
+ "optimizer_fused": null
66
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:56a38a4d96fc4fdcb6ff37e0b1aa3a23db165d5afb98f023282af311465c656d
3
+ size 206765336
policy_postprocessor.json ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "policy_postprocessor",
3
+ "steps": [
4
+ {
5
+ "registry_name": "unnormalizer_processor",
6
+ "config": {
7
+ "eps": 1e-08,
8
+ "features": {
9
+ "action": {
10
+ "type": "ACTION",
11
+ "shape": [
12
+ 14
13
+ ]
14
+ }
15
+ },
16
+ "norm_map": {
17
+ "VISUAL": "MEAN_STD",
18
+ "STATE": "MEAN_STD",
19
+ "ACTION": "MEAN_STD"
20
+ }
21
+ },
22
+ "state_file": "policy_postprocessor_step_0_unnormalizer_processor.safetensors"
23
+ },
24
+ {
25
+ "registry_name": "device_processor",
26
+ "config": {
27
+ "device": "cpu",
28
+ "float_dtype": null
29
+ }
30
+ }
31
+ ]
32
+ }
policy_postprocessor_step_0_unnormalizer_processor.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:797777e6e870b9c70a950b6860aa23d246ee8292a6f10f4bca727ab564e39348
3
+ size 3892
policy_preprocessor.json ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "policy_preprocessor",
3
+ "steps": [
4
+ {
5
+ "registry_name": "rename_observations_processor",
6
+ "config": {
7
+ "rename_map": {}
8
+ }
9
+ },
10
+ {
11
+ "registry_name": "to_batch_processor",
12
+ "config": {}
13
+ },
14
+ {
15
+ "registry_name": "device_processor",
16
+ "config": {
17
+ "device": "mps",
18
+ "float_dtype": null
19
+ }
20
+ },
21
+ {
22
+ "registry_name": "normalizer_processor",
23
+ "config": {
24
+ "eps": 1e-08,
25
+ "features": {
26
+ "observation.images.top": {
27
+ "type": "VISUAL",
28
+ "shape": [
29
+ 3,
30
+ 480,
31
+ 640
32
+ ]
33
+ },
34
+ "observation.state": {
35
+ "type": "STATE",
36
+ "shape": [
37
+ 14
38
+ ]
39
+ },
40
+ "action": {
41
+ "type": "ACTION",
42
+ "shape": [
43
+ 14
44
+ ]
45
+ }
46
+ },
47
+ "norm_map": {
48
+ "VISUAL": "MEAN_STD",
49
+ "STATE": "MEAN_STD",
50
+ "ACTION": "MEAN_STD"
51
+ }
52
+ },
53
+ "state_file": "policy_preprocessor_step_3_normalizer_processor.safetensors"
54
+ }
55
+ ]
56
+ }
policy_preprocessor_step_3_normalizer_processor.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dfee093c0b768d07b95824d3c670e35606ec969298df7ce7500a233bc1394058
3
+ size 3860
train_config.json ADDED
@@ -0,0 +1,300 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ "backend": "dataloader",
11
+ "gpu_compile": true,
12
+ "gpu_chunk_size": 32,
13
+ "max_num_transforms": 3,
14
+ "random_order": false,
15
+ "tfs": {
16
+ "brightness": {
17
+ "weight": 1.0,
18
+ "type": "ColorJitter",
19
+ "kwargs": {
20
+ "brightness": [
21
+ 0.8,
22
+ 1.2
23
+ ]
24
+ }
25
+ },
26
+ "contrast": {
27
+ "weight": 1.0,
28
+ "type": "ColorJitter",
29
+ "kwargs": {
30
+ "contrast": [
31
+ 0.8,
32
+ 1.2
33
+ ]
34
+ }
35
+ },
36
+ "saturation": {
37
+ "weight": 1.0,
38
+ "type": "ColorJitter",
39
+ "kwargs": {
40
+ "saturation": [
41
+ 0.5,
42
+ 1.5
43
+ ]
44
+ }
45
+ },
46
+ "hue": {
47
+ "weight": 1.0,
48
+ "type": "ColorJitter",
49
+ "kwargs": {
50
+ "hue": [
51
+ -0.05,
52
+ 0.05
53
+ ]
54
+ }
55
+ },
56
+ "sharpness": {
57
+ "weight": 1.0,
58
+ "type": "SharpnessJitter",
59
+ "kwargs": {
60
+ "sharpness": [
61
+ 0.5,
62
+ 1.5
63
+ ]
64
+ }
65
+ },
66
+ "affine": {
67
+ "weight": 1.0,
68
+ "type": "RandomAffine",
69
+ "kwargs": {
70
+ "degrees": [
71
+ -5.0,
72
+ 5.0
73
+ ],
74
+ "translate": [
75
+ 0.05,
76
+ 0.05
77
+ ]
78
+ }
79
+ }
80
+ }
81
+ },
82
+ "revision": null,
83
+ "use_imagenet_stats": true,
84
+ "video_backend": "torchcodec",
85
+ "return_uint8": false,
86
+ "depth_output_unit": "mm",
87
+ "streaming": false,
88
+ "streaming_episode_pool_size": null,
89
+ "streaming_sampling_strategy": "remaining",
90
+ "streaming_prefetch_episodes": 8,
91
+ "streaming_byte_budget_gb": 8.0,
92
+ "streaming_decode_threads": 2,
93
+ "streaming_decoded_queue_size": 8,
94
+ "streaming_native_http_connections": null,
95
+ "streaming_native_http_subranges": 1,
96
+ "streaming_sidecar_lock_timeout_s": 1800.0,
97
+ "video_decoder_cache_size": null,
98
+ "eval_split": 0.0
99
+ },
100
+ "env": {
101
+ "type": "aloha",
102
+ "task": "AlohaTransferCube-v0",
103
+ "fps": 50,
104
+ "features": {},
105
+ "features_map": {},
106
+ "max_parallel_tasks": 1,
107
+ "disable_env_checker": true,
108
+ "server": null,
109
+ "episode_length": 400,
110
+ "obs_type": "pixels_agent_pos",
111
+ "render_mode": "rgb_array"
112
+ },
113
+ "policy": {
114
+ "type": "act",
115
+ "n_obs_steps": 1,
116
+ "input_features": {
117
+ "observation.images.top": {
118
+ "type": "VISUAL",
119
+ "shape": [
120
+ 3,
121
+ 480,
122
+ 640
123
+ ]
124
+ },
125
+ "observation.state": {
126
+ "type": "STATE",
127
+ "shape": [
128
+ 14
129
+ ]
130
+ }
131
+ },
132
+ "output_features": {
133
+ "action": {
134
+ "type": "ACTION",
135
+ "shape": [
136
+ 14
137
+ ]
138
+ }
139
+ },
140
+ "device": "mps",
141
+ "dtype": null,
142
+ "use_amp": false,
143
+ "use_peft": false,
144
+ "push_to_hub": false,
145
+ "repo_id": null,
146
+ "private": null,
147
+ "tags": null,
148
+ "license": null,
149
+ "pretrained_path": null,
150
+ "pretrained_revision": null,
151
+ "chunk_size": 100,
152
+ "n_action_steps": 100,
153
+ "normalization_mapping": {
154
+ "VISUAL": "MEAN_STD",
155
+ "STATE": "MEAN_STD",
156
+ "ACTION": "MEAN_STD"
157
+ },
158
+ "vision_backbone": "resnet18",
159
+ "pretrained_backbone_weights": "ResNet18_Weights.IMAGENET1K_V1",
160
+ "replace_final_stride_with_dilation": 0,
161
+ "pre_norm": false,
162
+ "dim_model": 512,
163
+ "n_heads": 8,
164
+ "dim_feedforward": 3200,
165
+ "feedforward_activation": "relu",
166
+ "n_encoder_layers": 4,
167
+ "n_decoder_layers": 1,
168
+ "use_vae": true,
169
+ "latent_dim": 32,
170
+ "n_vae_encoder_layers": 4,
171
+ "temporal_ensemble_coeff": null,
172
+ "dropout": 0.1,
173
+ "kl_weight": 10.0,
174
+ "optimizer_lr": 1e-05,
175
+ "optimizer_weight_decay": 0.0001,
176
+ "optimizer_lr_backbone": 1e-05,
177
+ "optimizer_fused": null
178
+ },
179
+ "reward_model": null,
180
+ "output_dir": "outputs/train/act_transfer_cube_seed1000",
181
+ "job_name": "act_transfer_cube_seed1000",
182
+ "resume": true,
183
+ "seed": 1000,
184
+ "cudnn_deterministic": false,
185
+ "tf32": true,
186
+ "num_workers": 4,
187
+ "batch_size": 8,
188
+ "prefetch_factor": 4,
189
+ "persistent_workers": true,
190
+ "dataloader_multiprocessing_context": "spawn",
191
+ "steps": 80000,
192
+ "env_eval_freq": 0,
193
+ "log_freq": 200,
194
+ "eval_steps": 0,
195
+ "max_eval_samples": 0,
196
+ "tolerance_s": 0.0001,
197
+ "save_checkpoint": true,
198
+ "save_freq": 10000,
199
+ "checkpoint_format": "safetensors",
200
+ "use_policy_training_preset": true,
201
+ "optimizer": {
202
+ "type": "adamw",
203
+ "lr": 1e-05,
204
+ "weight_decay": 0.0001,
205
+ "grad_clip_norm": 10.0,
206
+ "betas": [
207
+ 0.9,
208
+ 0.999
209
+ ],
210
+ "eps": 1e-08,
211
+ "fused": null
212
+ },
213
+ "scheduler": null,
214
+ "parallelism": {
215
+ "dp_replicate": 1,
216
+ "dp_shard": 1,
217
+ "context_parallel": {
218
+ "ring_degree": 1,
219
+ "ulysses_degree": 1
220
+ },
221
+ "cfg_parallel": 1
222
+ },
223
+ "accelerator": {
224
+ "mixed_precision": "no",
225
+ "gradient_accumulation": {
226
+ "steps": 1,
227
+ "sync_each_batch": false
228
+ },
229
+ "grad_scaler": {
230
+ "init_scale": 65536.0,
231
+ "growth_factor": 2.0,
232
+ "backoff_factor": 0.5,
233
+ "growth_interval": 2000
234
+ },
235
+ "fsdp": {
236
+ "reshard_after_forward": true,
237
+ "wrap_modules": null,
238
+ "min_num_params": null,
239
+ "cpu_offload": false,
240
+ "ignored_modules": null,
241
+ "mixed_precision_policy": {
242
+ "param_dtype": null,
243
+ "reduce_dtype": null,
244
+ "output_dtype": null,
245
+ "cast_forward_inputs": true
246
+ }
247
+ },
248
+ "ddp": {
249
+ "find_unused_parameters": true,
250
+ "gradient_as_bucket_view": false,
251
+ "static_graph": false
252
+ },
253
+ "init_process_group": {
254
+ "backend": "nccl",
255
+ "init_method": null,
256
+ "timeout": null
257
+ },
258
+ "compile": {
259
+ "enabled": false,
260
+ "backend": "inductor",
261
+ "mode": null,
262
+ "regional": true
263
+ },
264
+ "activation_checkpointing": {
265
+ "mode": "none"
266
+ }
267
+ },
268
+ "eval": {
269
+ "n_episodes": 50,
270
+ "batch_size": 9,
271
+ "use_async_envs": true,
272
+ "recording": false,
273
+ "recording_repo_id": null,
274
+ "recording_private": false,
275
+ "max_episode_steps": null
276
+ },
277
+ "ema": null,
278
+ "trackio": {
279
+ "enable": false,
280
+ "disable_artifact": true,
281
+ "project": "lerobot",
282
+ "space_id": null,
283
+ "private": null,
284
+ "run_name": null,
285
+ "resume": null,
286
+ "capture_console": true
287
+ },
288
+ "peft": null,
289
+ "job": {
290
+ "target": null,
291
+ "image": "huggingface/lerobot-gpu:latest",
292
+ "timeout": "2d",
293
+ "detach": false,
294
+ "tags": []
295
+ },
296
+ "save_checkpoint_to_hub": false,
297
+ "sample_weighting": null,
298
+ "rename_map": {},
299
+ "checkpoint_path": "outputs/train/act_transfer_cube_seed1000/checkpoints/last"
300
+ }