Commit 768c305
authored
Report why fetching a pre-trained checkpoint failed (isaac-sim#7535)
# Description
Running a play script with `--checkpoint pretrained` on a machine whose
`.pretrained_checkpoints` directory was left behind by a container run
(owned by `root`) prints:
```
Fetching pre-trained checkpoint : https://.../rsl_rl/Isaac-Humanoid-Direct_newtonmjwarp_none_rsl_rl.pt
A pre-trained checkpoint is currently unavailable for this task.
```
and exits. The checkpoint is published and reachable; the download
failed with
`PermissionError: [Errno 13] Permission denied:
'.../.pretrained_checkpoints/rsl_rl/https'`. That error
was discarded by a bare `except Exception` in
`isaaclab_rl.utils.pretrained_checkpoint.get_published_pretrained_checkpoint`,
which reported every
failure — a missing checkpoint, an unreachable server, an unwritable
cache, a full disk — with the same
sentence and returned `None`, after which the play scripts return
without further explanation.
This separates the two cases:
* **The asset server does not provide the checkpoint.** `None` is still
returned and the message still
starts with `A pre-trained checkpoint is currently unavailable for this
task.`, so callers and tests
matching on that line are unaffected. It now also names the location
that was tried, the task and
backends that location was derived from, and what to do instead:
```
A pre-trained checkpoint is currently unavailable for this task.
The asset server does not provide
'https://.../Isaac-Not-A-Real-Task_newtonmjwarp_none_rsl_rl.pt'.
Either no checkpoint is published for task 'Isaac-Not-A-Real-Task' with
the 'newtonmjwarp' physics
and 'none' render backends, or the asset server could not be reached.
Train the task, or pass --checkpoint <path> to use a checkpoint of your
own.
```
* **The checkpoint exists but could not be downloaded.** This is a local
problem the user has to fix, so
it raises `RuntimeError` naming the checkpoint, the cache directory and
the originating error, which is
chained as the cause:
```
RuntimeError: Failed to download the pre-trained checkpoint
'https://.../Isaac-Humanoid-Direct_newtonmjwarp_none_rsl_rl.pt'
into '/home/user/IsaacLab/.pretrained_checkpoints/rsl_rl':
PermissionError: [Errno 13] Permission denied:
'/home/user/IsaacLab/.pretrained_checkpoints/rsl_rl/https'. Check that
the cache directory is writable and
that the disk is not full; a directory left behind by a container run is
owned by root.
```
Note that `omni.client` reports a checkpoint that was never published
and a server it cannot reach
identically, so both remain covered by the "unavailable" message.
Both paths were verified end to end against the live asset server, using
a published checkpoint with a
read-only cache directory and an unpublished checkpoint name.
## Type of change
- Bug fix (non-breaking change which fixes an issue)
Behaviour note: callers that relied on `None` to mask a local download
failure now see a `RuntimeError`.
Callers that treat `None` as "no checkpoint published for this task" —
every caller in the repository —
are unchanged. This is called out in the changelog fragment.
## Release backport
- [ ] <!-- backport-active-release --> Backport this pull request to the
active release branch after it merges into `develop`
## Checklist
- [x] I have read and understood the [contribution
guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html)
- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`./isaaclab.sh --format`
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] I have added a changelog fragment under
`source/<pkg>/changelog.d/` for every touched package
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there1 parent 59df9b8 commit 768c305
3 files changed
Lines changed: 107 additions & 3 deletions
File tree
- source/isaaclab_rl
- changelog.d
- isaaclab_rl/utils
- test
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
Lines changed: 38 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
242 | | - | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
243 | 252 | | |
244 | 253 | | |
245 | 254 | | |
| |||
252 | 261 | | |
253 | 262 | | |
254 | 263 | | |
255 | | - | |
256 | | - | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
257 | 279 | | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
258 | 293 | | |
259 | 294 | | |
260 | 295 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
0 commit comments