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

Incorrect flag parsing: purge_orphaned_data #1506

Closed
manzagop opened this issue Oct 10, 2018 · 0 comments
Closed

Incorrect flag parsing: purge_orphaned_data #1506

manzagop opened this issue Oct 10, 2018 · 0 comments

Comments

@manzagop
Copy link

Hi!

Thanks for a great tool!

Issue: It is not possible to disable "purging of orphaned data" through the purge_orphaned_data flag.

  • TensorBoard version: TOT (guessing that's 1.11.0)
  • Python version 2.7

The problem is with the argparse flag parsing[1]: using type=bool means the string argument will be converted to boolean, e.g. bool('False') => True.

`import argparse
parser = argparse.ArgumentParser(prog='foo')
parser.add_argument('--purge_orphaned_data', metavar='BOOL', type=bool, nargs=1, default=True)

In [6]: parser.parse_args('--purge_orphaned_data=False'.split())
Out[6]: Namespace(purge_orphaned_data=[True])`

Ways to fix this:

  • replace type=bool with something that does the right conversion. Note we'd likely also want to change nargs to '?' so as not to get a list
  • replace the flag with a "disabling flag" (action='set_false')

Note sure if the "absl flag integration" presents additional difficulties though [2].

[1] https://github.com/tensorflow/tensorboard/blob/master/tensorboard/plugins/core/core_plugin.py#L302
[2] https://github.com/tensorflow/tensorboard/blob/master/tensorboard/program.py#L55

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants