Instructions to use zengxy0624/diffusion-pusht-obstacles with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- LeRobot
How to use zengxy0624/diffusion-pusht-obstacles with LeRobot:
- Notebooks
- Google Colab
- Kaggle
Document raw_checkpoints/ in README
Browse files
README.md
CHANGED
|
@@ -63,6 +63,8 @@ Inherited from the base model (no architecture changes, only weight finetuning):
|
|
| 63 |
|
| 64 |
## Usage
|
| 65 |
|
|
|
|
|
|
|
| 66 |
```python
|
| 67 |
from lerobot.policies.diffusion.modeling_diffusion import DiffusionPolicy
|
| 68 |
|
|
@@ -73,6 +75,38 @@ policy.eval()
|
|
| 73 |
Drop-in compatible with the base model — same input/output schema, just
|
| 74 |
swap the repo id.
|
| 75 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 76 |
## Limitations
|
| 77 |
|
| 78 |
- Only trained on circular obstacles with radius 15 px and 1–3 per episode.
|
|
|
|
| 63 |
|
| 64 |
## Usage
|
| 65 |
|
| 66 |
+
### Standard inference (recommended)
|
| 67 |
+
|
| 68 |
```python
|
| 69 |
from lerobot.policies.diffusion.modeling_diffusion import DiffusionPolicy
|
| 70 |
|
|
|
|
| 75 |
Drop-in compatible with the base model — same input/output schema, just
|
| 76 |
swap the repo id.
|
| 77 |
|
| 78 |
+
### Raw checkpoints (every 5k steps)
|
| 79 |
+
|
| 80 |
+
The full run trajectory is also stored under `raw_checkpoints/` in the repo
|
| 81 |
+
for offline evaluation, ablations, or resuming training. These are PyTorch
|
| 82 |
+
`.pt` files in the original training format (NOT safetensors):
|
| 83 |
+
|
| 84 |
+
| File | Contents | Size | Use case |
|
| 85 |
+
|---|---|---|---|
|
| 86 |
+
| `raw_checkpoints/best.pt` | model + cfg + success | ~1 GB | Inference at peak success |
|
| 87 |
+
| `raw_checkpoints/final.pt` | model + cfg + step | ~1 GB | Last training step |
|
| 88 |
+
| `raw_checkpoints/step_{10,15,20,25,30}000.pt` | model + optimizer + scheduler + step | ~3 GB each | Resume training; per-step ablation |
|
| 89 |
+
|
| 90 |
+
Download e.g. one via:
|
| 91 |
+
|
| 92 |
+
```python
|
| 93 |
+
from huggingface_hub import hf_hub_download
|
| 94 |
+
import torch
|
| 95 |
+
|
| 96 |
+
path = hf_hub_download(
|
| 97 |
+
repo_id="zengxy0624/diffusion-pusht-obstacles",
|
| 98 |
+
filename="raw_checkpoints/step_20000.pt",
|
| 99 |
+
)
|
| 100 |
+
ckpt = torch.load(path, map_location="cpu", weights_only=False)
|
| 101 |
+
# ckpt["model"]: state_dict, ckpt["model_cfg"]: dict, ckpt["step"]: int (or "success" for best.pt)
|
| 102 |
+
```
|
| 103 |
+
|
| 104 |
+
Note: the schema (`model`, `model_cfg`, `optimizer`, `scheduler`, `step`,
|
| 105 |
+
`best_success`) is internal to the original training script
|
| 106 |
+
([finetune.py](https://github.com/Tool-as-Interface/Tool_as_Interface) of this
|
| 107 |
+
fork). Standard LeRobot tooling does NOT understand `.pt` files — use the
|
| 108 |
+
`config.json`/`model.safetensors` at the repo root for that.
|
| 109 |
+
|
| 110 |
## Limitations
|
| 111 |
|
| 112 |
- Only trained on circular obstacles with radius 15 px and 1–3 per episode.
|