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

print version with tensorboard --version #2097

Merged
merged 13 commits into from
Apr 18, 2019
3 changes: 3 additions & 0 deletions tensorboard/program.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,9 @@ def main(self, ignored_argv=('',)):
event_file = os.path.expanduser(self.flags.event_file)
efi.inspect(self.flags.logdir, event_file, self.flags.tag)
return 0
if self.flags.version:
Copy link
Contributor

Choose a reason for hiding this comment

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

You'll need to define the flag in core_plugin.py. See the --inspect flag definition for an example:

parser.add_argument(
'--inspect',
action='store_true',
help='''\
Prints digests of event files to command line.
This is useful when no data is shown on TensorBoard, or the data shown
looks weird.
Must specify one of `logdir` or `event_file` flag.
Example usage:
`tensorboard --inspect --logdir mylogdir --tag loss`
See tensorboard/backend/event_processing/event_file_inspector.py for more info.\
''')

Copy link
Contributor

@thealphacod3r thealphacod3r Apr 8, 2019

Choose a reason for hiding this comment

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

@shashvatshahi1998 if you're not working on this can i send pr for the same??

Copy link
Contributor

Choose a reason for hiding this comment

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

@nfelt Defined the flag in core_plugin.py

See #2100

Copy link
Contributor Author

@shashvatshahi1998 shashvatshahi1998 Apr 8, 2019

Choose a reason for hiding this comment

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

@amanp592 I was also working on the issue man.

Copy link
Contributor

Choose a reason for hiding this comment

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

@amanp592 please let @shashvatshahi1998 finish working on this PR since they've already started it, and the functionality should all be submitted as a single PR.

If you're looking for a simple issue, you could pick up #1176 which is for ensuring that if --path_prefix is used, the URL printed out includes a trailing slash. The fix for that would be changing get_url() here to add a trailing slash to the URL if there isn't one already there:

def get_url(self):
if self._auto_wildcard:
display_host = socket.gethostname()
else:
host = self._flags.host
display_host = (
'[%s]' % host if ':' in host and not host.startswith('[') else host)
return 'http://%s:%d%s' % (display_host, self.server_port,
self._flags.path_prefix)

A PR for that should also include a test to confirm the bug is fixed, which would go in

class WerkzeugServerTest(tf.test.TestCase):

Copy link
Contributor

Choose a reason for hiding this comment

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

@shashvatshahi1998 ohk cool sorry for that!

Copy link
Contributor

Choose a reason for hiding this comment

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

@nfelt Thankyou for refering me #1176 i'll look what can be done

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@amanp592 no worries

print(version.VERSION)
return 0
try:
server = self._make_server()
sys.stderr.write('TensorBoard %s at %s (Press CTRL+C to quit)\n' %
Expand Down