Lightning-AI / Lightning-AI/pytorch-lightning

CLI for inspecting checkpoints

Open
#5,551 2 comments 7 reactions 1 assignee View on GitHub

@awaelchli is already working on this.

Since Mar 8, 2021.

checkpointing design feature help wanted
Dominant language
Python
Stars
31.4k
Forks
3.8k
Avg merge
6d 7h
Merged PRs (30d)
6

Description

## 🚀 Feature

A quick way to inspect checkpoint files.

### Motivation

We don't know what's inside a checkpoint. Loading one and checking the contents requires us to write a python script.
A command line tool could help us load and inspect these checkpoint files conveniently. Useful for debugging too.

### Pitch

My implementation is [here](https://github.com/awaelchli/pytorch-lightning-snippets/blob/master/checkpoint/peek.py).
[Docs](https://github.com/awaelchli/pytorch-lightning-snippets#inspect-checkpoint-files)

```
Usage:

> peek path/to/checkpoint.ckpt
displays all top-level variables in a checkpoint file

> peek -i path/to/checkpoint.ckpt
interactive mode, loads the contents in a python interactive shell and let's you modify the contents
```

![peek](https://user-images.githubusercontent.com/5495193/104885825-f661af80-5968-11eb-8da0-38a8e1674375.gif)

Let me know if you want it

cc @borda @tchaton @justusschock @awaelchli @ananthsub @ninginthecloud @rohitgr7

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.