Commit 8132387f authored by Yuxin Wu's avatar Yuxin Wu

[MaskRCNN] from-scratch results

parent 0fa90c41
This diff is collapsed.
...@@ -116,6 +116,8 @@ class MultiThreadMapData(_ParallelMapData): ...@@ -116,6 +116,8 @@ class MultiThreadMapData(_ParallelMapData):
You can use **strict mode**, where `MultiThreadMapData.__iter__()` You can use **strict mode**, where `MultiThreadMapData.__iter__()`
is guaranteed to produce the exact set which `df.__iter__()` is guaranteed to produce the exact set which `df.__iter__()`
produces. Although the order of data still isn't preserved. produces. Although the order of data still isn't preserved.
The behavior of strict mode is undefined if the dataflow is infinite.
""" """
class _Worker(StoppableThread): class _Worker(StoppableThread):
def __init__(self, inq, outq, evt, map_func): def __init__(self, inq, outq, evt, map_func):
...@@ -219,6 +221,8 @@ class MultiProcessMapDataZMQ(_ParallelMapData, _MultiProcessZMQDataFlow): ...@@ -219,6 +221,8 @@ class MultiProcessMapDataZMQ(_ParallelMapData, _MultiProcessZMQDataFlow):
You can use **strict mode**, where `MultiProcessMapData.__iter__()` You can use **strict mode**, where `MultiProcessMapData.__iter__()`
is guaranteed to produce the exact set which `df.__iter__()` is guaranteed to produce the exact set which `df.__iter__()`
produces. Although the order of data still isn't preserved. produces. Although the order of data still isn't preserved.
The behavior of strict mode is undefined if the dataflow is infinite.
""" """
class _Worker(mp.Process): class _Worker(mp.Process):
def __init__(self, identity, map_func, pipename, hwm): def __init__(self, identity, map_func, pipename, hwm):
...@@ -405,8 +409,10 @@ if __name__ == '__main__': ...@@ -405,8 +409,10 @@ if __name__ == '__main__':
return x return x
ds = Zero(100) ds = Zero(100)
ds = MultiThreadMapData(ds, 50, f, buffer_size=50, strict=False) ds = MultiThreadMapData(ds, 50, f, buffer_size=50, strict=True)
ds.reset_state() ds.reset_state()
for k in ds: for idx, k in enumerate(ds):
print("Bang!", k) print("Bang!", k)
if idx == 100:
break
print("END!") print("END!")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment