wsagi commited on
Commit
c67ec24
·
verified ·
1 Parent(s): 0b06094

Add files using upload-large-folder tool

Browse files
README.md ADDED
@@ -0,0 +1,130 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ library_name: lerobot
4
+ pipeline_tag: robotics
5
+ tags:
6
+ - robotics
7
+ - diffusion-policy
8
+ - lerobot
9
+ - so-101
10
+ - so101
11
+ - pick-orange
12
+ - leisaac
13
+ datasets:
14
+ - LightwheelAI/leisaac-pick-orange
15
+ ---
16
+
17
+ # DiffusionPolicy — LeIsaac SO-101 PickOrange
18
+
19
+ From-scratch [Diffusion Policy](https://arxiv.org/abs/2303.04137) fine-tune on
20
+ [`LightwheelAI/leisaac-pick-orange`](https://huggingface.co/datasets/LightwheelAI/leisaac-pick-orange)
21
+ for the LeIsaac `LeIsaac-SO101-PickOrange-v0` task in Isaac Sim (SO-101 leader arm,
22
+ front + wrist cameras, three oranges → plate).
23
+
24
+ ## Headline result
25
+
26
+ | Eval budget | Episodes | Success rate |
27
+ | --- | --- | --- |
28
+ | 3 × 60 s | 3 | **1/3** (Episode 2: three oranges placed + arm returned to rest pose) |
29
+ | 3 × 180 s | 3 | _pending — see [Results](#results)_ |
30
+
31
+ Compared to other policies trained on the same 60 ep × 36 k frame dataset:
32
+
33
+ | Policy | Params | Eval window | Result |
34
+ | --- | --- | --- | --- |
35
+ | ACT ([`shadowHokage/act_policy`](https://huggingface.co/shadowHokage/act_policy)) | ~80 M | 60 s | ✅ 1/1 |
36
+ | GR00T N1.5 ([`LightwheelAI/leisaac-pick-orange-v0`](https://huggingface.co/LightwheelAI/leisaac-pick-orange-v0)) | ~3 B | 60 s | ✅ 1/1 |
37
+ | SmolVLA v1 (this repo's local fine-tune) | ~450 M | 120 s | 🟡 2/5 |
38
+ | **Diffusion Policy (this ckpt @ 100 k)** | **267 M** | **60 s** | **🟢 1/3** |
39
+
40
+ ## Training configuration
41
+
42
+ - **Base**: from scratch — no pre-trained backbone
43
+ - **Vision backbone**: ResNet18, `use_group_norm=True`, group norm replaces batch norm
44
+ - **Diffusion**: DDPM, 100 timesteps train + inference, ε-prediction
45
+ - **Architecture**: UNet down_dims `[512, 1024, 2048]`, `n_obs_steps=2`, `horizon=16`, `n_action_steps=8`
46
+ - **Image preproc**: input resolution 480×640, internally resized to 240×320 (`policy.resize_shape=[240, 320]`)
47
+ - **Cameras**: `observation.images.front`, `observation.images.wrist`
48
+ - **State**: 6 joints (5 arm + 1 gripper)
49
+ - **Optimizer**: Adam, lr 1e-4, weight_decay 1e-6, betas (0.95, 0.999)
50
+ - **Scheduler**: cosine with 500 warmup steps
51
+ - **Batch**: 32 per device
52
+ - **Steps**: 100,000 (resume @ 60k saved ckpt → continued to 100k under same config)
53
+ - **Time on 1× RTX 3090 24 GB**: ~8 h total, ~2.5 step/s steady-state
54
+ - **Video backend**: pyav (torchcodec + 4 workers segfaults on long runs)
55
+ - **Wandb**: disabled
56
+
57
+ Training driver: [`scripts/finetune/lerobot_finetune.sh`](https://github.com/vitorcen/LeIsaac/blob/main/scripts/finetune/lerobot_finetune.sh)
58
+ in [`vitorcen/LeIsaac`](https://github.com/vitorcen/LeIsaac), invoked as
59
+
60
+ ```bash
61
+ POLICY_TYPE=diffusion \
62
+ DATASET_REPO_ID=LightwheelAI/leisaac-pick-orange \
63
+ OUTPUT_NAME=dp-leisaac-pick-orange-v2 \
64
+ STEPS=100000 BATCH_SIZE=32 NUM_WORKERS=2 SAVE_FREQ=20000 \
65
+ EXTRA_ARGS='--dataset.video_backend=pyav --policy.resize_shape=[240,320]' \
66
+ bash scripts/finetune/lerobot_finetune.sh
67
+ ```
68
+
69
+ ## Inference
70
+
71
+ This ckpt is served via the LeRobot async-inference policy server. Two upstream
72
+ patches are required for Diffusion Policy to work through that path (the server
73
+ calls `predict_action_chunk()` instead of `select_action()`):
74
+
75
+ 1. `predict_action_chunk()` made self-populating — pops the rollout-side `ACTION`
76
+ stub from the input batch, stacks raw image keys into `OBS_IMAGES`, and feeds
77
+ the current observation into the policy's observation queue (auto-replicates
78
+ to fill `n_obs_steps` on first call). Without this the server hits either
79
+ `torch.stack([])` (empty deque) or `NoneType` (rollout `action=None` populated
80
+ into the action deque).
81
+ 2. Server-side traceback logging in `Error in StreamActions` for debuggability.
82
+
83
+ Both patches live in [`vitorcen/lerobot`](https://github.com/vitorcen/lerobot)
84
+ on top of LeRobot ≥ 0.5. Without them the server logs
85
+ `Error in StreamActions: stack expects a non-empty TensorList` and never
86
+ produces an action.
87
+
88
+ End-to-end eval recipe (Isaac Sim + LeIsaac client):
89
+
90
+ ```bash
91
+ # 1) Start LeRobot async-inference server
92
+ bash scripts/policy_server.sh start lerobot
93
+
94
+ # 2) Run policy eval against this ckpt
95
+ cd LeIsaac && \
96
+ PYTHONUNBUFFERED=1 python -u scripts/evaluation/policy_inference.py \
97
+ --task=LeIsaac-SO101-PickOrange-v0 \
98
+ --eval_rounds=3 --episode_length_s=60 \
99
+ --policy_type=lerobot-diffusion \
100
+ --policy_host=127.0.0.1 --policy_port=8080 \
101
+ --policy_timeout_ms=30000 \
102
+ --policy_language_instruction='Pick the orange to the plate' \
103
+ --policy_checkpoint_path=<path-to>/pretrained_model \
104
+ --policy_action_horizon=8 --device=cuda --enable_cameras
105
+ ```
106
+
107
+ ## Results
108
+
109
+ Success criterion (strict, defined in
110
+ [`pick_orange/mdp/terminations.py:task_done`](https://github.com/vitorcen/LeIsaac/blob/main/source/leisaac/leisaac/tasks/pick_orange/mdp/terminations.py)):
111
+ **all three oranges within plate x/y/z range AND the arm returned to rest
112
+ pose**.
113
+
114
+ - @ 60 k step: 0 / 3 success at 60 s, but Round 3 placed 2 of 3 oranges before
115
+ the timeout — capability was real, time/robustness budget was not.
116
+ - @ 100 k step: **1 / 3 success at 60 s** (Round 2: three oranges placed + rest
117
+ pose within 60 s). The other two rounds time out before all conditions are
118
+ met.
119
+
120
+ The success window is genuinely tight at 60 s for a 3-object pick-and-place
121
+ plus rest-pose recovery; a longer episode budget will likely improve the
122
+ reported rate.
123
+
124
+ ## License & attribution
125
+
126
+ - Code & weights: Apache-2.0
127
+ - Dataset: [`LightwheelAI/leisaac-pick-orange`](https://huggingface.co/datasets/LightwheelAI/leisaac-pick-orange)
128
+ (Apache-2.0)
129
+ - Policy class: LeRobot `--policy.type=diffusion`, Columbia Artificial
130
+ Intelligence, Robotics Lab et al.
config.json ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "type": "diffusion",
3
+ "n_obs_steps": 2,
4
+ "input_features": {
5
+ "observation.state": {
6
+ "type": "STATE",
7
+ "shape": [
8
+ 6
9
+ ]
10
+ },
11
+ "observation.images.front": {
12
+ "type": "VISUAL",
13
+ "shape": [
14
+ 3,
15
+ 480,
16
+ 640
17
+ ]
18
+ },
19
+ "observation.images.wrist": {
20
+ "type": "VISUAL",
21
+ "shape": [
22
+ 3,
23
+ 480,
24
+ 640
25
+ ]
26
+ }
27
+ },
28
+ "output_features": {
29
+ "action": {
30
+ "type": "ACTION",
31
+ "shape": [
32
+ 6
33
+ ]
34
+ }
35
+ },
36
+ "device": "cuda",
37
+ "use_amp": false,
38
+ "use_peft": false,
39
+ "push_to_hub": false,
40
+ "repo_id": null,
41
+ "private": null,
42
+ "tags": null,
43
+ "license": null,
44
+ "pretrained_path": "/home/david/work/LeIsaac/outputs/dp-leisaac-pick-orange-v2/checkpoints/060000/pretrained_model",
45
+ "horizon": 16,
46
+ "n_action_steps": 8,
47
+ "normalization_mapping": {
48
+ "VISUAL": "MEAN_STD",
49
+ "STATE": "MIN_MAX",
50
+ "ACTION": "MIN_MAX"
51
+ },
52
+ "drop_n_last_frames": 7,
53
+ "vision_backbone": "resnet18",
54
+ "resize_shape": [
55
+ 240,
56
+ 320
57
+ ],
58
+ "crop_ratio": 1.0,
59
+ "crop_shape": null,
60
+ "crop_is_random": true,
61
+ "pretrained_backbone_weights": null,
62
+ "use_group_norm": true,
63
+ "spatial_softmax_num_keypoints": 32,
64
+ "use_separate_rgb_encoder_per_camera": false,
65
+ "down_dims": [
66
+ 512,
67
+ 1024,
68
+ 2048
69
+ ],
70
+ "kernel_size": 5,
71
+ "n_groups": 8,
72
+ "diffusion_step_embed_dim": 128,
73
+ "use_film_scale_modulation": true,
74
+ "noise_scheduler_type": "DDPM",
75
+ "num_train_timesteps": 100,
76
+ "beta_schedule": "squaredcos_cap_v2",
77
+ "beta_start": 0.0001,
78
+ "beta_end": 0.02,
79
+ "prediction_type": "epsilon",
80
+ "clip_sample": true,
81
+ "clip_sample_range": 1.0,
82
+ "num_inference_steps": null,
83
+ "compile_model": false,
84
+ "compile_mode": "reduce-overhead",
85
+ "do_mask_loss_for_padding": false,
86
+ "optimizer_lr": 0.0001,
87
+ "optimizer_betas": [
88
+ 0.95,
89
+ 0.999
90
+ ],
91
+ "optimizer_eps": 1e-08,
92
+ "optimizer_weight_decay": 1e-06,
93
+ "scheduler_name": "cosine",
94
+ "scheduler_warmup_steps": 500
95
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8f20edc59961b09e28a9233653a2cd16a81e5417e5c90f21a9afa03eeb4bf35d
3
+ size 1066516952
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
+ 6
13
+ ]
14
+ }
15
+ },
16
+ "norm_map": {
17
+ "VISUAL": "MEAN_STD",
18
+ "STATE": "MIN_MAX",
19
+ "ACTION": "MIN_MAX"
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:0b9214914398156f17ddf08a5082c20b24efb70a7ba7677e8bc3d3ff68a722db
3
+ size 3756
policy_preprocessor.json ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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": "cuda",
18
+ "float_dtype": null
19
+ }
20
+ },
21
+ {
22
+ "registry_name": "normalizer_processor",
23
+ "config": {
24
+ "eps": 1e-08,
25
+ "features": {
26
+ "observation.state": {
27
+ "type": "STATE",
28
+ "shape": [
29
+ 6
30
+ ]
31
+ },
32
+ "observation.images.front": {
33
+ "type": "VISUAL",
34
+ "shape": [
35
+ 3,
36
+ 480,
37
+ 640
38
+ ]
39
+ },
40
+ "observation.images.wrist": {
41
+ "type": "VISUAL",
42
+ "shape": [
43
+ 3,
44
+ 480,
45
+ 640
46
+ ]
47
+ },
48
+ "action": {
49
+ "type": "ACTION",
50
+ "shape": [
51
+ 6
52
+ ]
53
+ }
54
+ },
55
+ "norm_map": {
56
+ "VISUAL": "MEAN_STD",
57
+ "STATE": "MIN_MAX",
58
+ "ACTION": "MIN_MAX"
59
+ }
60
+ },
61
+ "state_file": "policy_preprocessor_step_3_normalizer_processor.safetensors"
62
+ }
63
+ ]
64
+ }
policy_preprocessor_step_3_normalizer_processor.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0b9214914398156f17ddf08a5082c20b24efb70a7ba7677e8bc3d3ff68a722db
3
+ size 3756
train_config.json ADDED
@@ -0,0 +1,234 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "dataset": {
3
+ "repo_id": "LightwheelAI/leisaac-pick-orange",
4
+ "root": "/home/david/work/LeIsaac/datasets/raw/leisaac-pick-orange",
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": "pyav",
80
+ "return_uint8": false,
81
+ "streaming": false
82
+ },
83
+ "env": null,
84
+ "policy": {
85
+ "type": "diffusion",
86
+ "n_obs_steps": 2,
87
+ "input_features": {
88
+ "observation.state": {
89
+ "type": "STATE",
90
+ "shape": [
91
+ 6
92
+ ]
93
+ },
94
+ "observation.images.front": {
95
+ "type": "VISUAL",
96
+ "shape": [
97
+ 3,
98
+ 480,
99
+ 640
100
+ ]
101
+ },
102
+ "observation.images.wrist": {
103
+ "type": "VISUAL",
104
+ "shape": [
105
+ 3,
106
+ 480,
107
+ 640
108
+ ]
109
+ }
110
+ },
111
+ "output_features": {
112
+ "action": {
113
+ "type": "ACTION",
114
+ "shape": [
115
+ 6
116
+ ]
117
+ }
118
+ },
119
+ "device": "cuda",
120
+ "use_amp": false,
121
+ "use_peft": false,
122
+ "push_to_hub": false,
123
+ "repo_id": null,
124
+ "private": null,
125
+ "tags": null,
126
+ "license": null,
127
+ "pretrained_path": "/home/david/work/LeIsaac/outputs/dp-leisaac-pick-orange-v2/checkpoints/060000/pretrained_model",
128
+ "horizon": 16,
129
+ "n_action_steps": 8,
130
+ "normalization_mapping": {
131
+ "VISUAL": "MEAN_STD",
132
+ "STATE": "MIN_MAX",
133
+ "ACTION": "MIN_MAX"
134
+ },
135
+ "drop_n_last_frames": 7,
136
+ "vision_backbone": "resnet18",
137
+ "resize_shape": [
138
+ 240,
139
+ 320
140
+ ],
141
+ "crop_ratio": 1.0,
142
+ "crop_shape": null,
143
+ "crop_is_random": true,
144
+ "pretrained_backbone_weights": null,
145
+ "use_group_norm": true,
146
+ "spatial_softmax_num_keypoints": 32,
147
+ "use_separate_rgb_encoder_per_camera": false,
148
+ "down_dims": [
149
+ 512,
150
+ 1024,
151
+ 2048
152
+ ],
153
+ "kernel_size": 5,
154
+ "n_groups": 8,
155
+ "diffusion_step_embed_dim": 128,
156
+ "use_film_scale_modulation": true,
157
+ "noise_scheduler_type": "DDPM",
158
+ "num_train_timesteps": 100,
159
+ "beta_schedule": "squaredcos_cap_v2",
160
+ "beta_start": 0.0001,
161
+ "beta_end": 0.02,
162
+ "prediction_type": "epsilon",
163
+ "clip_sample": true,
164
+ "clip_sample_range": 1.0,
165
+ "num_inference_steps": null,
166
+ "compile_model": false,
167
+ "compile_mode": "reduce-overhead",
168
+ "do_mask_loss_for_padding": false,
169
+ "optimizer_lr": 0.0001,
170
+ "optimizer_betas": [
171
+ 0.95,
172
+ 0.999
173
+ ],
174
+ "optimizer_eps": 1e-08,
175
+ "optimizer_weight_decay": 1e-06,
176
+ "scheduler_name": "cosine",
177
+ "scheduler_warmup_steps": 500
178
+ },
179
+ "output_dir": "/home/david/work/LeIsaac/outputs/dp-leisaac-pick-orange-v2",
180
+ "job_name": "diffusion",
181
+ "resume": true,
182
+ "seed": 1000,
183
+ "cudnn_deterministic": false,
184
+ "num_workers": 2,
185
+ "batch_size": 32,
186
+ "prefetch_factor": 4,
187
+ "persistent_workers": true,
188
+ "steps": 100000,
189
+ "eval_freq": 20000,
190
+ "log_freq": 200,
191
+ "tolerance_s": 0.0001,
192
+ "save_checkpoint": true,
193
+ "save_freq": 20000,
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
+ "eval": {
212
+ "n_episodes": 50,
213
+ "batch_size": 22,
214
+ "use_async_envs": true
215
+ },
216
+ "wandb": {
217
+ "enable": false,
218
+ "disable_artifact": false,
219
+ "project": "lerobot",
220
+ "entity": null,
221
+ "notes": null,
222
+ "run_id": null,
223
+ "mode": null,
224
+ "add_tags": true
225
+ },
226
+ "peft": null,
227
+ "use_rabc": false,
228
+ "rabc_progress_path": null,
229
+ "rabc_kappa": 0.01,
230
+ "rabc_epsilon": 1e-06,
231
+ "rabc_head_mode": "sparse",
232
+ "rename_map": {},
233
+ "checkpoint_path": "/home/david/work/LeIsaac/outputs/dp-leisaac-pick-orange-v2/checkpoints/060000"
234
+ }