-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for sending the PR!
@@ -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: |
There was a problem hiding this comment.
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:
tensorboard/tensorboard/plugins/core/core_plugin.py
Lines 363 to 378 in dc71eee
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.\ | |
''') |
There was a problem hiding this comment.
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??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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:
tensorboard/tensorboard/program.py
Lines 519 to 527 in dc71eee
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
tensorboard/tensorboard/program_test.py
Line 43 in dc71eee
class WerkzeugServerTest(tf.test.TestCase): |
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@amanp592 no worries
please @nfelt review it |
@nfelt please soomebody review this PR as its more than 4 days now . |
@shashvatshahi1998 Nick is currently out of office until end of today. Since this is not urgent feature, I would like to respect his time off. Would you mind waiting one more day? Perhaps this is urgent to you, but I do not comprehend your requirements. I would appreciate it if you could you inform me why this is urgent. Thanks! |
@stephanwlee there is no urgency , I can wait for one more day. Basically I was not aware of the fact that @nfelt is not available. |
Please @nfelt, @stephanwlee somebody reviews this PR, it's like more than 10 days that I have opened it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @shashvatshahi1998. We don't promise any particular turnaround time on PRs, and this particular addition is not urgent (not a bugfix or pressing feature). The team reviewing these has multiple priorities and we are not available 24/7 due to holidays, weekends, etc. I'd like to ask for a bit more patience going forward - multiple pings in a short time period (in this case, 5 within 24 hours last week) is not going to increase the chance that your PR gets reviewed, it will just spam the team when we have other work that is more pressing.
As for the PR contents: this looks good, but right now trying to run tensorboard --version
will print an error about needing to supply --logdir
or --db
flags, which shouldn't be necessary to just print the version. Can you please fix this by modifying the check in fix_flags()
here:
if flags.inspect: |
It should be updated to something like:
if flags.version:
pass # Don't validate flags if we're just printing the version.
elif flags.inspect:
...
@nfelt i have done the changes which you asked me to do then why travis cl test is failing |
To fix the test, you'll need to edit core_plugin_test.py and add a version field to FakeFlags here: tensorboard/tensorboard/plugins/core/core_plugin_test.py Lines 46 to 58 in c38f4ec
You should also add a test that you can pass just
E.g. add the line |
@nfelt done with changes told by you. |
@@ -52,6 +52,7 @@ def __init__( | |||
db='', | |||
path_prefix=''): | |||
self.inspect = inspect | |||
self.version = version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You also need to add version
as a parameter to __init__()
.
@@ -47,11 +47,13 @@ class FakeFlags(object): | |||
def __init__( | |||
self, | |||
inspect, | |||
version, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs a default value of False, and so does inspect
above.
@nfelt done with changes asked by you |
@nfelt it has passed the checks now. |
@nfelt I think its complete now. |
tensorboard
should support --version
#2087tensorboard --version
@nfelt I want to work on more issues. Can you please give me some issues which are good for beginner? |
@shashvatshahi1998 you could take a look at #2121 to update our metaclass syntax to be compatible with Python 3. |
Issue was related to this change
Added version flag in main
Screenshots of UI changes
Issue #2087