Created
August 24, 2017 11:56
-
-
Save peterroelants/529eeb77c83eef4238b15365c5d680db to your computer and use it in GitHub Desktop.
Iterator Initializer Hook
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class IteratorInitializerHook(tf.train.SessionRunHook): | |
"""Hook to initialise data iterator after Session is created.""" | |
def __init__(self): | |
super(IteratorInitializerHook, self).__init__() | |
self.iterator_initializer_func = None | |
def after_create_session(self, session, coord): | |
"""Initialise the iterator after the session has been created.""" | |
self.iterator_initializer_func(session) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment