KEMBAR78
core: split magic `--logdir_spec` out from verbatim `--logdir` by wchargin · Pull Request #2664 · tensorflow/tensorboard · GitHub
Skip to content

Conversation

@wchargin
Copy link
Contributor

Summary:
This introduces a new flag, --logdir_spec, whose behavior is the same
as the old behavior of --logdir. The --logdir flag now specifies a
single log directory, without special treatment for commas and colons,
though it still has the expanduser call for compatibility with users
who use the --logdir=~/... form rather than --logdir ~/....

I audited all uses of flags.logdir and context.logdir, and, other
than those changed in this commit, all really should be using logdir
rather than logdir_spec (i.e., they do not properly parse the logdir
spec, and so were broken before this commit).

Fixes #2615, fixes #1220, and fixes lots of user confusion.

Test Plan:
Run with the following args:

--logdir ~/data/  # should work as usual
--logdir=~/data/  # should work as usual
--logdir ~/data/scalars_demo,~/data/audio_demo  # should be empty
--logdir ~/data/mnist/lr_1E-03,conv=1,fc=2  # should work now!
--logdir_spec ~/data/  # should work, but without projector, et al.
--logdir_spec ~/data/scalars_demo,~/data/audio_demo  # should work

wchargin-branch: logdir-spec

Summary:
This introduces a new flag, `--logdir_spec`, whose behavior is the same
as the old behavior of `--logdir`. The `--logdir` flag now specifies a
single log directory, without special treatment for commas and colons,
though it still has the `expanduser` call for compatibility with users
who use the `--logdir=~/...` form rather than `--logdir ~/...`.

I audited all uses of `flags.logdir` and `context.logdir`, and, other
than those changed in this commit, all really should be using `logdir`
rather than `logdir_spec` (i.e., they do not properly parse the logdir
spec, and so were broken before this commit).

Fixes #2615, fixes #1220, and fixes lots of user confusion.

Test Plan:
Run with the following args:

    --logdir ~/data/  # should work as usual
    --logdir=~/data/  # should work as usual
    --logdir ~/data/scalars_demo,~/data/audio_demo  # should be empty
    --logdir ~/data/mnist/lr_1E-03,conv=1,fc=2  # should work now!
    --logdir_spec ~/data/  # should work, but without projector, et al.
    --logdir_spec ~/data/scalars_demo,~/data/audio_demo  # should work

wchargin-branch: logdir-spec
Copy link
Contributor

@nfelt nfelt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for fixing!

logdir: The string logging directory TensorBoard was started with. If this
is set, the db_uri should be None.
logdir: The string logging directory TensorBoard was started with.
logdir_spec: The value of `--logdir_spec` passed to TensorBoard (see
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's just have the data location handler consult context.flags.logdir_spec directly, even though it's uglier, to avoid presenting logdir_spec as something that plugin implementers can depend on. (If we did want them to use it we'd probably want to pass it to them in parsed form, not the colon and comma delimited form.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. Done.

wchargin-branch: logdir-spec
wchargin-source: 718e5d26402863cf144acb4df4a5a05ca0cabb0a
@wchargin wchargin merged commit 2d6964d into master Sep 18, 2019
@wchargin wchargin deleted the wchargin-logdir-spec branch September 18, 2019 02:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove special treatment for commas and colons in logdir specifiers --logdir unexpectedly interprets commas and colons

3 participants