Skip to main content

Read, parse, and plot tensorboard event logs with ease!

Project description

tbparse

tests build doc codecov pypi python Downloads

A simple yet powerful tensorboard event log parser/reader.

  • Supports parsing tensorboard event scalars, tensors, and histograms.
  • Supports event generated by PyTorch, Tensorboard/Keras, and TensorboardX, with their respective usage examples documented in detail.
  • Allows parsing multiple tensorboard event files in a hierarchical directory structure.
  • Provides plotting examples for each type of events.
  • Stores the data in pandas.DataFrame to allow advanced filtering.
  • Both the documentation and code have high test coverage rate.
  • Follows PEP 484 with full type hints.

Installation: (Requires python >= 3.7)

pip install -U tbparse

We suggest using an additional virtual environment for parsing and plotting the tensorboard events. So no worries if your training code uses Python 3.6 or older versions.

Reading one or more event files with tbparse only requires 5 lines of code:

from tbparse import SummaryReader
log_dir = "<PATH_TO_EVENT_FILE_OR_DIRECTORY>"
reader = SummaryReader(log_dir)
df = reader.scalars
print(df)

For beginners, start from the page: Parsing Scalars.

Currently, tbparse enables parsing native types (scalars, tensors, histograms, etc.) easily. More event types will be supported in future versions.

Installation

pip install -U tbparse

(Requires python >= 3.7)

Testing the Source Code

Test source code:

python3 -m pip install tox
python3 -m tox

Test and build documentation:

cd docs
make clean
# sphinx-tabs seems to require html be built before doctest
make html
make doctest

Generate test coverage:

python3 -m pip install pandas tensorflow torch tensorboardX pytest pytest-cov
python3 -m pytest --cov=./ --cov-report html

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tbparse-0.0.3.tar.gz (11.5 kB view hashes)

Uploaded Source

Built Distribution

tbparse-0.0.3-py3-none-any.whl (10.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page