Skip to content

Commit 4cbdd60

Browse files
committed
Refine documentation of available checkpoints and exported models
1 parent ac44a00 commit 4cbdd60

File tree

1 file changed

+61
-16
lines changed

1 file changed

+61
-16
lines changed

README.md

Lines changed: 61 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ Docker installation instructions are [here](https://docs.docker.com/engine/insta
3535

3636
During the first run of any example, Docker will build the images. Go grab a coffee while this happens. Subsequent runs will be faster since the images are cached.
3737

38-
### Downloading checkpoints
38+
### Downloading assets
3939

40-
By default checkpoints are downloaded from `s3://openpi-assets` and are cached in `~/.cache/openpi` when needed. You can overwrite the download path by setting the `OPENPI_DATA_HOME` environment variable.
40+
By default, assets like checkpoints and exported models are downloaded from `s3://openpi-assets` and are cached in `~/.cache/openpi` when needed. You can overwrite the download path by setting the `OPENPI_DATA_HOME` environment variable.
4141

4242
## Running Training
4343

@@ -101,40 +101,85 @@ uv run scripts/serve_policy.py --env LIBERO --default_prompt "my task"
101101

102102
### Serve a trained policy from an openpi checkpoint
103103

104-
This option allows serving a model that was trained using the openpi training code.
104+
This option allows serving a model that was trained using the openpi training code. Here's an example of how to serve a checkpoint that corresponds to the `pi0_aloha_sim` training config:
105105

106106
```bash
107107
uv run scripts/serve_policy.py --default_prompt "my task" policy:checkpoint --policy.config=pi0_aloha_sim --policy.dir=checkpoints/pi0_aloha_sim/exp_name/10000
108108
```
109109

110+
See the [list of available checkpoints](#available-checkpoints) below for more details.
111+
110112
The training config is used to determine which data transformations should be applied to the runtime data before feeding into the model. The norm stats, which are used to normalize the transformed data, are loaded from the checkpoint directory.
111113

112114
### Serve an exported model
113115

114-
There are also a number of checkpoints that are available as exported JAX graphs, which we trained ourselves using our internal training code. These can be served using the following command:
116+
There are also a number of checkpoints that are available as exported JAX graphs, which we trained ourselves using our internal training code. Here's an example of how to serve the pre-trained $\pi_0$ model on an ALOHA robot:
115117

116118
```bash
117-
uv run scripts/serve_policy.py --env ALOHA policy:exported --policy.dir=s3://openpi-assets/exported/pi0_base/model [--policy.processor=trossen_biarm_single_base_cam_24dim]
119+
uv run scripts/serve_policy.py --env ALOHA policy:exported --policy.dir=s3://openpi-assets/exported/pi0_base/model --policy.processor=trossen_biarm_single_base_cam_24dim
118120
```
119121

122+
See the [list of available exported models](#available-exported-models) below for more details.
123+
120124
For these exported models, norm stats are loaded from processors that are exported along with the model, while data transformations are defined by the --env argument (see `create_exported_policy` in [scripts/serve_policy.py](scripts/serve_policy.py)). The processor name is optional, and if not provided, we will do the following:
121125
- Load a processor if there is only one available
122126
- Raise an error if there are multiple processors available and ask to provide a processor name
123127

128+
### Available policies
129+
130+
#### Checkpoints
131+
132+
All available openpi checkpoints are located in `s3://openpi-assets/checkpoints/`. Similar to checkpionts that were trained using the openpi training code, they can be served using the following command:
133+
134+
```bash
135+
uv run scripts/serve_policy.py --default_prompt=<prompt> policy:checkpoint --policy.config=<config> --policy.dir=<dir>
136+
```
137+
138+
| dir | config | prompt | description |
139+
| ------------------------------------------------ | --------------- | ------------------ | -------------------------------------------------------------------------- |
140+
| `s3://openpi-assets/checkpoints/pi0_aloha` | `pi0_aloha` | not needed | $\pi_0$ model fine-tuned on public ALOHA data, supports pen cap/uncap task |
141+
| `s3://openpi-assets/checkpoints/pi0_aloha_towel` | `pi0_aloha` | `"fold the towel"` | $\pi_0$ model fine-tuned to perform a towel folding task on ALOHA |
142+
| `s3://openpi-assets/checkpoints/pi0_aloha_sim` | `pi0_aloha_sim` | not needed | $\pi_0$ model fine-tuned on public simulated ALOHA cube transfer task |
143+
144+
#### Exported models
145+
146+
NOTE: We are in the process of converting all exported fine-tuned models into checkpoints.
147+
148+
All available openpi exported models are located in `s3://openpi-assets/exported/`. They can be served using the following command:
149+
150+
```bash
151+
uv run scripts/serve_policy.py --env=<env> --default_prompt=<prompt> policy:exported --policy.dir=<dir>
152+
```
153+
154+
| dir | env | prompt | description |
155+
| ---------------------------------------------- | -------- | ------------------ | ----------------------------------------------------------- |
156+
| `s3://openpi-assets/exported/pi0_droid/model` | `DROID` | any DROID command | $\pi_0$ model fine-tuned on public DROID dataset |
157+
| `s3://openpi-assets/exported/pi0_calvin/model` | `CALVIN` | any CALVIN command | $\pi_0$ model fine-tuned on public CALVIN simulated dataset |
158+
| `s3://openpi-assets/exported/pi0_libero/model` | `LIBERO` | any LIBERO command | $\pi_0$ model fine-tuned on public LIBERO simulated dataset |
159+
160+
#### Standard pre-trained $\pi_0$ model
161+
162+
Our standard pre-trained $\pi_0$ model is available both as a checkpoint and an exported model.
163+
164+
The checkpoint is used to initialize the model weights for fine-tuning using:
165+
166+
```python
167+
weight_loader=weight_loaders.CheckpointWeightLoader("s3://openpi-assets/checkpoints/pi0_base/params"),
168+
```
169+
170+
Although it may not perform well in zero-shot, it can be used as a baseline for comparing against fine-tuned models. We currently don't support serving pi0_base as a checkpoint and recommend using the exported model instead:
171+
172+
```bash
173+
uv run scripts/serve_policy.py --env=<env> policy:exported --policy.dir=s3://openpi-assets/exported/pi0_base/model --policy.processor=<processor>
174+
```
124175

125-
### Available exported models
176+
Here's a list of supported environments and corresponding processors:
126177

127-
We currently have the following exported models available for use. See [scripts/serve_policy.py](scripts/serve_policy.py) for details.
178+
| env | processor |
179+
| ------- | ------------------------------------- |
180+
| `ALOHA` | `trossen_biarm_single_base_cam_24dim` |
181+
| `DROID` | `openx_droid` |
128182

129-
| name | path | env | recommended language command | description |
130-
| ----------------- | --------------------------------------------------- | ---------------- | ---------------------------- | -------------------------------------------------------------------------- |
131-
| `pi0_base` | `s3://openpi-assets/exported/pi0_base/model/` | `ALOHA`, `DROID` | `"be a good robot"` | Standard pre-trained $\pi_0$, may not perform well in zero-shot |
132-
| `pi0_aloha` | `s3://openpi-assets/exported/pi0_aloha/model` | `ALOHA` | `""` | $\pi_0$ model fine-tuned on public ALOHA data, supports pen cap/uncap task |
133-
| `pi0_aloha_towel` | `s3://openpi-assets/exported/pi0_aloha_towel/model` | `ALOHA` | `"fold the towel"` | $\pi_0$ model fine-tuned to perform a towel folding task on ALOHA |
134-
| `pi0_aloha_sim` | `s3://openpi-assets/exported/pi0_aloha_sim/model` | `ALOHA_SIM` | `"be a good robot"` | $\pi_0$ model fine-tuned on public simulated ALOHA cube transfer task |
135-
| `pi0_droid` | `s3://openpi-assets/exported/pi0_droid/model` | `DROID` | any DROID command | $\pi_0$ model fine-tuned on public DROID dataset |
136-
| `pi0_calvin` | `s3://openpi-assets/exported/pi0_calvin/model` | `CALVIN` | any CALVIN command | $\pi_0$ model fine-tuned on public CALVIN simulated dataset |
137-
| `pi0_libero` | `s3://openpi-assets/exported/pi0_libero/model` | `LIBERO` | any LIBERO command | $\pi_0$ model fine-tuned on public LIBERO simulated dataset |
138183

139184
### Running with Docker:
140185

0 commit comments

Comments
 (0)