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
# Based on the example from the TensorFlow repository: https://github.com/tensorflow/tensorflow/ | |
# https://github.com/tensorflow/tensorflow/blob/671baf080238025da9698ea980cd9504005f727c/tensorflow/examples/learn/text_classification_character_rnn.py | |
from __future__ import absolute_import | |
from __future__ import division | |
from __future__ import print_function | |
import argparse | |
import sys |
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
while not self.jobs_finished or self.jobs_left > 0: | |
try: | |
report = progress_queue.get(timeout=2) # blocks if workers too slow | |
except Empty: | |
logger.info("Jobs left: %d" % self.jobs_left) | |
logger.info("Job queue size: %i" % utils.qsize(job_queue)) | |
if self.jobs_finished: | |
import time | |
logger.info("Sleeping 10 secs.") | |
time.sleep(10) |