-
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
Make sure compat PyRecordReader_New reads new data #2342
Conversation
Looks good! |
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.
Can you add a minimal test for the record reader that at least covers this case and ideally a few other basic ones? I think the fact that this bug persisted is evidence that the implementation is different enough from the original that this really should have tests.
Good point - changing test.
On Jun 17, 2019, at 3:40 PM, Nick Felt <[email protected]<mailto:[email protected]>> wrote:
@nfelt commented on this pull request.
Can you add a minimal test for the record reader that at least covers this case and ideally a few other basic ones? I think the fact that this bug persisted is evidence that the implementation is different enough from the original that this really should have tests.
________________________________
In tensorboard/compat/tensorflow_stub/pywrap_tensorflow.py<#2342 (comment)>:
-
- if self.index >= len(self.event_strs) - 1:
+ if self.file_handle is None:
+ if self.filename is None:
+ raise errors.NotFoundError(
+ None, None, 'No filename provided, cannot read Events')
+ if not gfile.exists(self.filename):
+ raise errors.NotFoundError(
+ None, None,
+ '{} does not point to valid Events file'.format(self.filename))
+ if self.compression_type:
+ # TODO: Handle gzip and zlib compressed files
+ raise errors.UnimplementedError(
+ None, None, 'compression not supported by compat reader')
+ self.file_handle = gfile.GFile(self.filename, 'rb')
+ self.file_handle.seek(self.start_offset)
TensorBoard's usage of PyRecordReader_New never passes in the start_offset argument, so I'd rather leave out that implementation and avoid expanding the GFile API surface we support. We can just raise an UnimplementedError instead if start_offset is provided.
________________________________
In tensorboard/compat/tensorflow_stub/pywrap_tensorflow.py<#2342 (comment)>:
def GetNext(self):
- if not self.done_reading:
- self.read()
-
- if self.index >= len(self.event_strs) - 1:
+ if self.file_handle is None:
+ if self.filename is None:
+ raise errors.NotFoundError(
+ None, None, 'No filename provided, cannot read Events')
+ if not gfile.exists(self.filename):
+ raise errors.NotFoundError(
+ None, None,
+ '{} does not point to valid Events file'.format(self.filename))
+ if self.compression_type:
Let's handle this in the constructor instead.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#2342?email_source=notifications&email_token=AAATQ6R23HF6KIDNPE4YTZLP3AHEBA5CNFSM4HXEHDQKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOB3ZJ4KY#pullrequestreview-250781227>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AAATQ6WE4ND2UTGEDY2SGILP3AHEBANCNFSM4HXEHDQA>.
|
@nfelt if tests pass this should be ready for another review. Much appreciated. |
Hi, @nfelt, i have install tb_nightly (version 2.1.0a20191021), and restart tensorboard --log_dir target dir, and it still shows that "TensorFlow installation not found - running with reduced feature set." I'm confused |
This fixes pytorch/pytorch#20477
It looks like our original compat implementation of
PyRecordReader_New
didn't continue to try and read content from a file after it had done the original read. This updates the class to continue to request data from the file and read in new events. Note that this would only be seen in the non-TensorFlow case. Here's a test case:While the above is running, execute the following
train.py
script located in../realtime_runs/
:with
python train.py
With the old code TensorBoard won't update. With the updated code it will as expected.
cc @nfelt, @natalialunova, @wchargin, @lanpa