tensorboard icon indicating copy to clipboard operation
tensorboard copied to clipboard

`InspectionUnit.generator` is useless as the one-time generator is already used by `get_field_to_observations_map`

Open mazurkin opened this issue 8 months ago • 0 comments

Environment information (required)

TensorBoard 2.19

Issue description

I am trying to access the TensorBoard data for my own graphs, alerting and review

import tensorboard.backend.event_processing.event_file_inspector

a = tensorboard.backend.event_processing.event_file_inspector.get_inspection_units(logdir=manager.summary_folder)
# Found event files in:
# runs/20250514-105417
# runs/20250514-105417/loss_epoch_trn
# runs/20250514-105417/loss_trn
# runs/20250514-105417/loss_epoch_tst

a[1].name
# 'runs/20250514-105417/loss_epoch_trn'

list(a[1].generator)
# [] <- this the problem

I noticed all generators from generators_from_logdir can be used only once and probably this is the problem, as this generator is already used in field_to_obs=get_field_to_observations_map(generator, tag):

inspection_units.append(
    InspectionUnit(
        name=subdir,
        generator=generator,
        field_to_obs=get_field_to_observations_map(generator, tag),
    )
)

It would be nice to have a clean API to access the metrics from TensorBoard without installing whole TensorFlow package.

mazurkin avatar May 14 '25 15:05 mazurkin