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.2.tar.gz
(12.4 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.2.tar.gz.
File metadata
- Download URL: nndiagnostics-0.1.2.tar.gz
- Upload date:
- Size: 12.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5699abb1b66aff2eeab1c5c74bb737f1c216dec8970b0101745e8fda1a9f1700
|
|
| MD5 |
4b5aa06d81dbf837b05816e876ef0a35
|
|
| BLAKE2b-256 |
d0ea48950073f57aff3105aba5f180e4e86b2050a6b0bfe03c62d2abeee2ba21
|
File details
Details for the file nndiagnostics-0.1.2-py3-none-any.whl.
File metadata
- Download URL: nndiagnostics-0.1.2-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 |
3513d26ba8879ac7aec6662f65662c57b403032a6187c7fbd11f7243f2e4e1df
|
|
| MD5 |
b9755d3ab3c67a786c58b6c7cdb364b7
|
|
| BLAKE2b-256 |
48fda8945714f67d9e9b6edc5ef2715ed3d56396fe4315f9a4c5764743e56e92
|