Lightweight PyTorch tensor diagnostics hooks for training loops
Project description
NN diagnostics
A useful tool to dump diagnostics info from checkpoint.
Install
pip install nndiagnostics
Quick Start
- Integrate diagnostics in your training loop
from diagnostics import maybe_attach_diagnostics
diag = maybe_attach_diagnostics(model)
for step, batch in enumerate(train_loader):
loss = train_step(batch)
loss.backward()
optimizer.step()
optimizer.zero_grad()
if diag and diag.should_stop(step, stop_after_steps=6):
diag.print(f"{args.exp_dir}/diagnostics-step-{step}.txt")
break
- Dump diagnostics information (by setting env
DUMP_DIAGNOSTICS)
DUMP_DIAGNOSTICS=1 python train.py
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
nndiagnostics-0.1.1.tar.gz
(12.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nndiagnostics-0.1.1.tar.gz.
File metadata
- Download URL: nndiagnostics-0.1.1.tar.gz
- Upload date:
- Size: 12.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e813c192ae82e9ab405c5d06ee7ad11d9564a7e82fbd0e2b2c545611367a6fe9
|
|
| MD5 |
fd95acdd6f3635036c528796fbd8cc29
|
|
| BLAKE2b-256 |
894958a450bb79f7e35540e45072d9bfe1775fcda31aeffbf2b82ef0cd0ee1ef
|
File details
Details for the file nndiagnostics-0.1.1-py3-none-any.whl.
File metadata
- Download URL: nndiagnostics-0.1.1-py3-none-any.whl
- Upload date:
- Size: 12.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b7f63bb7658a05cc84520e0ae2ba2ff1566a1001006dd760743f5d7a590706d
|
|
| MD5 |
63ea075c7b0c955b95ff9598e367c532
|
|
| BLAKE2b-256 |
e0ce1d491bca76da14af892f156ab9ddc1a9d07eb8b286bd3427f8b6376c58a9
|