yerang commited on
Commit
075781b
·
verified ·
1 Parent(s): 6ecb068

Update stf/stf-api-alternative/src/stf_alternative/readers.py

Browse files
stf/stf-api-alternative/src/stf_alternative/readers.py CHANGED
@@ -44,7 +44,9 @@ class ImageDataset(Dataset):
44
 
45
  class ProcessPoolIterator:
46
  def __init__(self, dataset, preload=8, num_workers=2):
47
- self.pool = ProcessPoolExecutor(num_workers)
 
 
48
  self.dataset = dataset
49
  self.queue = deque()
50
  self.preload = preload
@@ -95,7 +97,8 @@ class ProcessPoolBatchIterator:
95
 
96
  class AsyncProcessPoolIterator:
97
  def __init__(self, dataset, preload=8, num_workers=4):
98
- self.pool = ProcessPoolExecutor(num_workers)
 
99
  self.dataset = dataset
100
  self.queue = deque()
101
  self.preload = preload
 
44
 
45
  class ProcessPoolIterator:
46
  def __init__(self, dataset, preload=8, num_workers=2):
47
+ #self.pool = ProcessPoolExecutor(num_workers)
48
+ self.pool = ThreadPoolExecutor(num_workers)
49
+
50
  self.dataset = dataset
51
  self.queue = deque()
52
  self.preload = preload
 
97
 
98
  class AsyncProcessPoolIterator:
99
  def __init__(self, dataset, preload=8, num_workers=4):
100
+ #self.pool = ProcessPoolExecutor(num_workers)
101
+ self.pool = ThreadPoolExecutor(num_workers)
102
  self.dataset = dataset
103
  self.queue = deque()
104
  self.preload = preload