Beispiel #1
0
 def minibatch_loader_thread(self):
     """Load mini-batches and put them onto the mini-batch queue."""
     with self.coordinator.stop_on_exception():
         while not self.coordinator.should_stop():
             blobs = self.get_next_minibatch()
             # Blobs must be queued in the order specified by
             # self.get_output_names
             ordered_blobs = OrderedDict()
             for key in self.get_output_names():
                 assert blobs[key].dtype in (np.int32, np.float32), \
                     'Blob {} of dtype {} must have dtype of ' \
                     'np.int32 or np.float32'.format(key, blobs[key].dtype)
                 ordered_blobs[key] = blobs[key]
             coordinated_put(self.coordinator, self._minibatch_queue,
                             ordered_blobs)
     logger.info('Stopping mini-batch loading thread')
Beispiel #2
0
 def minibatch_loader_thread(self):
     """Load mini-batches and put them onto the mini-batch queue."""
     with self.coordinator.stop_on_exception():
         while not self.coordinator.should_stop():
             blobs = self.get_next_minibatch()
             # Blobs must be queued in the order specified by
             # self.get_output_names
             ordered_blobs = OrderedDict()
             for key in self.get_output_names():
                 assert blobs[key].dtype in (np.int32, np.float32), \
                     'Blob {} of dtype {} must have dtype of ' \
                     'np.int32 or np.float32'.format(key, blobs[key].dtype)
                 ordered_blobs[key] = blobs[key]
             coordinated_put(
                 self.coordinator, self._minibatch_queue, ordered_blobs
             )
     logger.info('Stopping mini-batch loading thread')