Registry / ai-ml / tbparse

tbparse

JSON →
library0.0.9pypypi✓ verified 85d ago

tbparse is a Python library that allows users to load TensorBoard event logs directly into pandas DataFrames. It provides an easy way to read, parse, and plot TensorBoard data, simplifying analysis for machine learning experiments. The current version is 0.0.9, and the library maintains an active release cadence with frequent updates and bug fixes.

pip install tbparse
INSTALL
IMPORT
SIG · TBPARSE
T
tbparse
ai-mlpythonv0.0.9
Install
11.1s avg
Import
1527ms
Disk
235MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.0.9 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 1.921s · 222MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 11.1s · import 1.133s · 232MB
235MB installed
● package 235MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

SummaryReader
from tbparse import SummaryReader

Initialize a SummaryReader with your TensorBoard log directory and access event types like 'scalars' or 'histograms' as pandas DataFrames. The example includes a basic check for log directory existence.

import os from tbparse import SummaryReader # Create a dummy log directory for demonstration log_dir = './logs/example_run' if not os.path.exists(log_dir): os.makedirs(log_dir) # In a real scenario, TensorBoard logs would be generated here # For this quickstart, we'll assume logs exist or will be generated later # Example usage: # Replace 'path/to/your/log_dir' with your actual TensorBoard log directory try: reader = SummaryReader(log_dir) df = reader.scalars print("Scalars DataFrame (first 5 rows):") print(df.head()) if not df.empty: # Access specific columns print(f"\nAvailable tags: {df['tag'].unique()}") except FileNotFoundError: print(f"Warning: Log directory '{log_dir}' not found or empty. Please ensure TensorBoard logs are present.") except Exception as e: print(f"An error occurred: {e}")
Debug
Known issues
breakingPython 3.7 support has been dropped starting from `tbparse` v0.0.9. Users on Python 3.7 will need to upgrade their Python version or use an older `tbparse` version.
fix
Upgrade Python to 3.8 or newer. Alternatively, pin `tbparse<0.0.9` in your `requirements.txt` if using Python 3.7.
affects: >=0.0.9
breakingThe behavior of the `event_types` parameter for `SummaryReader` was changed in v0.0.7. This might lead to unexpected filtering or empty results if you relied on the old behavior.
fix
Review your usage of `event_types` in `SummaryReader`'s constructor or `read()` method. Consult the official documentation for the updated filtering semantics.
affects: >=0.0.7
breakingThe `histogram` API was unified in v0.0.6. If you were using specific methods or parameters for histograms prior to this version, your code might break.
fix
Update your code to use the unified `histogram` API as described in the `tbparse` documentation. Check for methods that might have been deprecated or renamed.
affects: >=0.0.6
gotchaWhile `tbparse` can parse many event types without `tensorflow` (especially after v0.0.9), full functionality for complex events like images, audio, or older tensor formats might still require `tensorflow` to be installed.
fix
If you encounter errors parsing specific event types or expect more data than you receive, try installing `tensorflow` alongside `tbparse` (`pip install tensorflow`).
affects: all
breakingThe parameters for `SummaryReader` were clarified and potentially changed in v0.0.3. This could affect code that directly instantiated `SummaryReader` with specific arguments in older versions.
fix
Check the `SummaryReader` constructor's parameters in the `tbparse` documentation and update your instantiation calls accordingly.
affects: >=0.0.3
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'pandas'
The `pandas` library, which `tbparse` relies on for DataFrame operations, is not installed in your environment.
fix
Install `pandas` using `pip install pandas`.
FileNotFoundError: [Errno 2] No such file or directory: 'path/to/your/log_dir'
The specified log directory for `SummaryReader` does not exist or is inaccessible. This could also mean the directory is empty or does not contain valid TensorBoard event files.
fix
Verify that the path to your TensorBoard log directory is correct and that it contains `.tfevents` files generated by TensorBoard. Ensure `SummaryReader` points to the *parent* directory containing the run subdirectories, or directly to a run directory.
tensorflow.errors.NotFoundError: No OpKernel was registered to support Op 'DecodePng'
This error typically occurs when trying to parse image or audio events without the `tensorflow` library installed, or with a `tensorflow` version mismatch that prevents the necessary operations.
fix
Install `tensorflow` in your environment (`pip install tensorflow`). Ensure it's a compatible version with your Python setup. `tbparse` v0.0.9 includes some parsing without `tensorflow`, but for full coverage, it's often needed.
TypeError: 'event_types' parameter changed its behavior. Please check the documentation.
You are likely using `tbparse` v0.0.7 or newer, and your code is still relying on the deprecated behavior of the `event_types` parameter in `SummaryReader`.
fix
Consult the `tbparse` documentation for `SummaryReader` to understand the updated `event_types` parameter behavior and adjust your code accordingly. You might need to refine your filtering logic.
Upgrade
Version history
0.0.9latest on PyPI · released Aug 16, 2024
Audit
Dependencies
pandasrequiredCore dependency for DataFrame operations.
tensorflowoptionalOptional dependency for full support of all event types (e.g., images, audio, older tensor formats), though tbparse can parse many types without it as of v0.0.9.
Agent activity
14 hits · last 30 days
node
12
Amazon
1
OpenAI (training)
1
Resources