Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hparams: Workaround problem with '/.' in run names. #6791

Merged
merged 1 commit into from
Mar 15, 2024

Conversation

bmd3k
Copy link
Contributor

@bmd3k bmd3k commented Mar 15, 2024

Some responses from data_provider.read_last_scalars() may contain run names of the following form: 'SOME_EXPERIMENT_OR_SOMETHING/.', with a trailing '/.' at the end.

'.' always behaves sort of weird with Hparams and this is no exception. The problem in this case is that sessions of this sort could not be matched with metric values. No metric values would appear for them in the hparams dashboard.

This is because the logic to generate metric names drops the '/.' and so we could not match. That code relies on some os-level path operations and we know that '.' has special meaning for filesystems:

run = os.path.normpath(os.path.join(session_name, metric_name.group))

We fix the problem by transforming the result of data_provider.read_last_scalars() to apply the same os-level path operations to the run names (ie the keys of the result).

@bmd3k bmd3k force-pushed the hparams-20240315-slashdot-problem branch from 6829afa to c0c94dd Compare March 15, 2024 19:59
@bmd3k bmd3k requested a review from yatbear March 15, 2024 20:16
@bmd3k bmd3k merged commit af4700f into tensorflow:master Mar 15, 2024
13 checks passed
AnuarTB pushed a commit to AnuarTB/tensorboard that referenced this pull request May 3, 2024
Some responses from data_provider.read_last_scalars() may contain run
names of the following form: 'SOME_EXPERIMENT_OR_SOMETHING/.', with a
trailing '/.' at the end.

'.' always behaves sort of weird with Hparams and this is no exception.
The problem in this case is that sessions of this sort could not be
matched with metric values. No metric values would appear for them in
the hparams dashboard.

This is because the logic to generate metric names drops the '/.' and so
we could not match. That code relies on some os-level path operations
and we know that '.' has special meaning for filesystems:

https://github.com/tensorflow/tensorboard/blob/23073c55c03f2f1a9da8c7e0bb9db3349dc15c90/tensorboard/plugins/hparams/metrics.py#L39

We fix the problem by transforming the result of
data_provider.read_last_scalars() to apply the same os-level path
operations to the run names (ie the keys of the result).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants