-
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
Don't pass a status to _reader.GetNext() #1086
Conversation
What versions of TensorFlow does this apply to? We may want to maintain compatibility with older versions. |
This GitHub depends on Speaking of which, I'd like to learn about what magic makes the |
The removal of with is based on the same idea as cl/191121016 (my cl/190950450 just expands the scope of the SWIG change). When a C function with a param "TF_Status* status" is wrapped by SWIG, the generated wrapper will correctly generate a TF_NewStatus(), and pass it into the C function. On exit of the C function, the wrapper will check and raise the appropriate error. |
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.
Oh fabulous. "Raise exception in SWIG on bad TF_Status from C API" (cl/191121016) looks like it'll have asteroid impact. It was however committed a few hours ago. You can move forward with your CL. We'll merge this tomorrow.
Apologies for the misunderstanding: that change "Raise exception in SWIG on bad TF_Status from C API" will not actually break any of tensorboard. My change (Apply "Raise exception in SWIG on bad TF_Status" to base.i) which is not yet submitted will break tensorboard without this PR, but I won't be submitting my change till Monday most likely. So hopefully this will get submitted after. |
@akshaym will this change mean that GetNext() will actually forbid a status argument, or will it just ignore it? Only asking since if the status argument is only deprecated it could be useful to leave this in place so users of older TF versions can use newer TB versions (we don't promise this but if it's easy to do, it seems worthwhile). |
@nfelt Unfortunately, it will forbid it. |
Based on test output, it seems like we're still awaiting a release of |
Yes, this is still awaiting a release. Hopefully by tomorrow. |
@akshaym maybe we could check the arguments to GetNext() here and condition the behavior on whether it has a status argument? E.g. as follows. That would unblock this PR and also mean we preserve at least some support for TF <= 1.7, which would be nice since users often have to stick with old TF versions but want to upgrade TensorBoard. import inspect
...
if inspect.getargspec(_reader.GetNext).args[1:]:
self._reader.GetNext()
else:
# GetNext() expects a status argument on TF <= 1.7
with tf.errors.raise_exception_on_not_ok_status() as status:
self._reader.GetNext(status) |
@nfelt Done. Thanks! |
@@ -49,8 +51,12 @@ def Load(self): | |||
tf.logging.debug('Loading events from %s', self._file_path) | |||
while True: | |||
try: | |||
with tf.errors.raise_exception_on_not_ok_status() as status: | |||
self._reader.GetNext(status) | |||
if len(inspect.getargspec(self._reader.GetNext).args) is 0: |
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.
Does checking for length 0 work? When i was looking at this, "self" is considered the first argument (even though it's a bound function):
>>> inspect.getargspec(reader.GetNext).args
['self', 'status']
Oops, went back to look at my example and I got the negation wrong, my bad. I should have said "not args[1:]" but at that point an explicit length check is probably clearer.
@@ -49,8 +51,12 @@ def Load(self): | |||
tf.logging.debug('Loading events from %s', self._file_path) | |||
while True: | |||
try: | |||
with tf.errors.raise_exception_on_not_ok_status() as status: | |||
self._reader.GetNext(status) | |||
if len(inspect.getargspec(self._reader.GetNext).args) is 0: |
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.
Also looks like pylint is complaining about getargspec being deprecated on py3.6+. For now probably fine to just suppress deprecated-method
warning on this line. I think getfullargspec() is the replacement, but it's not available on Python 2...
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 yeah - I saw that - I also assumed the code works fine (with the "is 0" check) since it didn't complain about this.
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.
I think it didn't complain because right now with existing tf-nightly len(args) == 2 so this branch isn't triggered. But when tf-nightly picks up your change, len(args) will be == 1 (since "self" will still count as an argument), so this check will still fail, even though the intent is that it should pass. So I think this should be if len(args) == 1: # only the "self" argument
to anticipate that change.
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 making the change backwards-compatible!
Thanks very much for your help with this! |
When will this go into 1.7 update? |
Since it's backwards compatible, I don't see any reason why it can't be cherry-picked, to help out our friends who build TF at HEAD. |
@jgberg we could do a cherry-pick if you need one, but note that when building TF at HEAD (or using tf-nightly) it's best to use tb-nightly, the TensorBoard equivalent, rather than the specific TensorBoard releases. |
Thanks! Though I may revert to tf1.6 as my team and I are juggling many
things. Nojetheless, others may well benefit if you do. It’s bitten others
on our team just to say it... the issue may be widespread...
…On Tue, Apr 10, 2018 at 11:14 PM Nick Felt ***@***.***> wrote:
@jgberg <https://github.com/jgberg> we could do a cherry-pick if you need
one, but note that when building TF at HEAD (or using tf-nightly) it's best
to use tb-nightly, the TensorBoard equivalent, rather than the specific
TensorBoard releases.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1086 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAQh9k_X4jyEE4pY1gAWShClyzgFlQuOks5tnZ9CgaJpZM4TCRXm>
.
|
Tensorflow's C API now will now raise this error using SWIG without having to raise it in explicitly in Python.
replacing |
Thanks Sangjee, though I've found that installing Tensorboard v1.8 on top
of TF v1.7 and smiling while ignoring the complaints has worked for my
purposes...
…On Thu, May 3, 2018 at 6:03 AM, Sangjee Dondrub ***@***.***> wrote:
replacingtensorboard/backend/event_processing/event_file_loader.py with
lateset one works
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1086 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAQh9iDeFL2G2cLr6pxTtaFM4lH7qi5Tks5tuwAzgaJpZM4TCRXm>
.
|
Tensorflow's C API now will now raise this error using SWIG without having to raise it in explicitly in Python.