def __init__(self, file_prefix):
'''
Events files have a name of the form
'/some/file/path/events.out.tfevents.[timestamp].[hostname]'
'''
self._file_prefix = file_prefix + ".out.tfevents." \
+ str(time.time())[:10] + "." + socket.gethostname()
# Open(Create) the log file with the particular form of name.
logging.basicConfig(filename=self._file_prefix)
self._num_outstanding_events = 0
self._py_recordio_writer = RecordWriter(self._file_prefix)
# Initialize an event instance.
self._event = event_pb2.Event()
self._event.wall_time = time.time()
self.write_event(self._event)
评论列表
文章目录