Commit 451e6183 authored by Yuxin Wu's avatar Yuxin Wu

fix bug in InferenceRunner

parent 13723a91
...@@ -166,6 +166,7 @@ _C.MRCNN.HEAD_DIM = 256 ...@@ -166,6 +166,7 @@ _C.MRCNN.HEAD_DIM = 256
_C.TEST.FRCNN_NMS_THRESH = 0.5 _C.TEST.FRCNN_NMS_THRESH = 0.5
# Smaller threshold value gives significantly better mAP. But we use 0.05 for consistency with Detectron. # Smaller threshold value gives significantly better mAP. But we use 0.05 for consistency with Detectron.
# mAP with 1e-4 threshold can be found at https://github.com/tensorpack/tensorpack/commit/26321ae58120af2568bdbf2269f32aa708d425a8#diff-61085c48abee915b584027e1085e1043 # noqa
_C.TEST.RESULT_SCORE_THRESH = 0.05 _C.TEST.RESULT_SCORE_THRESH = 0.05
_C.TEST.RESULT_SCORE_THRESH_VIS = 0.3 # only visualize confident results _C.TEST.RESULT_SCORE_THRESH_VIS = 0.3 # only visualize confident results
_C.TEST.RESULTS_PER_IM = 100 _C.TEST.RESULTS_PER_IM = 100
......
...@@ -214,7 +214,7 @@ class DataParallelInferenceRunner(InferenceRunnerBase): ...@@ -214,7 +214,7 @@ class DataParallelInferenceRunner(InferenceRunnerBase):
input_callbacks = self._input_source.setup(tower_func.inputs_desc) input_callbacks = self._input_source.setup(tower_func.inputs_desc)
with tf.variable_scope(tf.get_variable_scope(), reuse=True): with tf.variable_scope(tf.get_variable_scope(), reuse=True):
for idx, dev in enumerate(self._devices): for idx, dev in enumerate(self._devices):
vs_name = self._vs_name_for_predictor(idx) vs_name = self.trainer._vs_name_for_predictor(idx)
with tf.device(dev), PredictTowerContext( with tf.device(dev), PredictTowerContext(
self._tower_names[idx], vs_name=vs_name): self._tower_names[idx], vs_name=vs_name):
logger.info("[InferenceRunner] Building tower '{}' on device {} {}...".format( logger.info("[InferenceRunner] Building tower '{}' on device {} {}...".format(
......
...@@ -231,11 +231,12 @@ class PrefetchDataZMQ(_MultiProcessZMQDataFlow): ...@@ -231,11 +231,12 @@ class PrefetchDataZMQ(_MultiProcessZMQDataFlow):
Please note that forking a TensorFlow GPU session may be unsafe. Please note that forking a TensorFlow GPU session may be unsafe.
If you're managing this dataflow on your own, If you're managing this dataflow on your own,
it's better to fork before creating the session. it's better to fork before creating the session.
4. After the fork has happened, this dataflow becomes not fork-safe. 4. (Fork-safety) After the fork has happened, this dataflow becomes not fork-safe.
i.e., if you fork an already reset instance of this dataflow, i.e., if you fork an already reset instance of this dataflow,
it won't be usable in the forked process. it won't be usable in the forked process. Therefore, do not nest two `PrefetchDataZMQ`.
5. Do not nest two `PrefetchDataZMQ`. 5. (Thread-safety) ZMQ is not thread safe. Therefore, do not call :meth:`get_data` of the same dataflow in
6. By default, a UNIX named pipe will be created in the current directory. more than 1 threads.
6. (For Mac only) A UNIX named pipe will be created in the current directory.
However, certain non-local filesystem such as NFS/GlusterFS/AFS doesn't always support pipes. However, certain non-local filesystem such as NFS/GlusterFS/AFS doesn't always support pipes.
You can change the directory by ``export TENSORPACK_PIPEDIR=/other/dir``. You can change the directory by ``export TENSORPACK_PIPEDIR=/other/dir``.
In particular, you can use somewhere under '/tmp' which is usually local. In particular, you can use somewhere under '/tmp' which is usually local.
...@@ -428,6 +429,8 @@ class PlasmaGetData(ProxyDataFlow): ...@@ -428,6 +429,8 @@ class PlasmaGetData(ProxyDataFlow):
""" """
Take plasma object id from a DataFlow, and retrieve it from plasma shared Take plasma object id from a DataFlow, and retrieve it from plasma shared
memory object store. memory object store.
Experimental.
""" """
def __init__(self, ds, socket="/tmp/plasma"): def __init__(self, ds, socket="/tmp/plasma"):
self._socket = socket self._socket = socket
......
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