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

core: split magic --logdir_spec out from verbatim --logdir #2664

Merged
merged 2 commits into from
Sep 18, 2019

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants