]> git.sesse.net Git - voxel-flow/commitdiff
Update to Python 3 syntax.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 8 Feb 2018 18:48:54 +0000 (19:48 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 8 Feb 2018 18:48:54 +0000 (19:48 +0100)
utils/prefetch_queue_shuffle.py
voxel_flow_train.py

index 5d391a9bf7e60d2084906581753bf1c2e5844a0a..b488649bf01703b7fbc76adf8d75a267ee7de93c 100755 (executable)
@@ -3,7 +3,7 @@ from __future__ import print_function
 import glob
 import numpy as np
 import os 
-import Queue
+import queue
 import random
 import scipy
 from scipy import misc
@@ -55,7 +55,7 @@ class PrefetchQueue(object):
 
     # Start prefetching thread
     # self.prefetch_queue = Queue.Queue(maxsize=prefetch_size)
-    self.prefetch_queue = Queue.PriorityQueue(maxsize=prefetch_size)
+    self.prefetch_queue = queue.PriorityQueue(maxsize=prefetch_size)
     for k in range(num_workers):
       t = threading.Thread(target=prefetch_job,
         args=(self.load_fn, self.prefetch_queue, self.data_list,
index f6d3abb67a0f062e6750c0b3bd8471174be1b8f6..4440e798410e9ec4b16f638146a5d4fcf8862be4 100755 (executable)
@@ -118,7 +118,7 @@ def train(dataset_frame1, dataset_frame2, dataset_frame3):
     # load_fn_frame3 = partial(dataset_frame3.process_func)
     # p_queue_frame3 = PrefetchQueue(load_fn_frame3, data_list_frame3, FLAGS.batch_size, shuffle=False, num_workers=num_workers)
 
-    for step in xrange(0, FLAGS.max_steps):
+    for step in range(0, FLAGS.max_steps):
       batch_idx = step % epoch_num
       
       batch_data_list_frame1 = data_list_frame1[int(batch_idx * FLAGS.batch_size) : int((batch_idx + 1) * FLAGS.batch_size)]