nvitop/examples/ml-framework-callbacks
2026-05-16 15:41:21 +08:00
..
keras.py chore: update stale cross references in docs 2026-05-16 15:41:21 +08:00
lightning.py chore: update stale cross references in docs 2026-05-16 15:41:21 +08:00
README.md chore: update stale cross references in docs 2026-05-16 15:41:21 +08:00
requirements-keras.txt chore: update stale cross references in docs 2026-05-16 15:41:21 +08:00
requirements-lightning.txt chore: update stale cross references in docs 2026-05-16 15:41:21 +08:00
requirements-tensorboard.txt chore: update stale cross references in docs 2026-05-16 15:41:21 +08:00
tensorboard.py chore: update stale cross references in docs 2026-05-16 15:41:21 +08:00

ML-Framework Callbacks

Self-contained GpuStatsLogger callbacks for Keras and Lightning, plus a tiny TensorBoard helper. Each file has zero dependencies on the others — copy a single .py into your project and adapt the imports.

Files and Dependencies

File Install command Purpose
keras.py pip install -r requirements-keras.txt Keras Callback logging GPU stats per training batch.
lightning.py pip install -r requirements-lightning.txt Lightning Callback (lightning.pytorch.callbacks.Callback) for GPU stats.
tensorboard.py pip install -r requirements-tensorboard.txt add_scalar_dict — batched SummaryWriter.add_scalar for a flat metric dict.

Each requirements-*.txt pins only what that single file needs, so you do not pull in TensorFlow when you only want the Lightning callback.

See ../README.md for the full example index.