Skip to content

Commit

Permalink
Hparams: Workaround problem with '/.' in run names.
Browse files Browse the repository at this point in the history
  • Loading branch information
bmd3k committed Mar 15, 2024
1 parent 23073c5 commit c0c94dd
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tensorboard/plugins/hparams/backend_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,19 @@ def read_last_scalars(self, ctx, experiment_id, run_tag_filter):
value, with keys only for runs and tags that actually had
data, which may be a subset of what was requested.
"""
return self._tb_context.data_provider.read_last_scalars(
last_scalars = self._tb_context.data_provider.read_last_scalars(
ctx,
experiment_id=experiment_id,
plugin_name=scalar_metadata.PLUGIN_NAME,
run_tag_filter=run_tag_filter,
)
# Transform keys from the data provider using some of the same os-level
# filesystem operations used to generate metric names elsewhere.
# This will, for example, translate runs with name 'SOMETHING/.' to
# 'SOMETHING'.
return {
os.path.normpath(key): value for key, value in last_scalars.items()
}

def hparams_from_data_provider(self, ctx, experiment_id, limit):
"""Calls DataProvider.list_hyperparameters() and returns the result."""
Expand Down

0 comments on commit c0c94dd

Please sign in to comment.