Faster-RCNN_Tensorflow icon indicating copy to clipboard operation
Faster-RCNN_Tensorflow copied to clipboard

build_whole_network中的代码请教

Open sigma-alpha-beta opened this issue 7 years ago • 0 comments

        with tf.control_dependencies([rpn_labels]):
            with tf.variable_scope('sample_RCNN_minibatch'):
                rois, labels, bbox_targets = \
                tf.py_func(proposal_target_layer,
                           [rois, gtboxes_batch],
                           [tf.float32, tf.float32, tf.float32])
                rois = tf.reshape(rois, [-1, 4])
                labels = tf.to_int32(labels)
                labels = tf.reshape(labels, [-1])
                bbox_targets = tf.reshape(bbox_targets, [-1, 4*(cfgs.CLASS_NUM+1)])
                self.add_roi_batch_img_smry(input_img_batch, rois, labels)

请问在404行的代码中为什么要使用 with tf.control_dependencies([rpn_labels])?我看proposal_target_layer中没有依赖rpn_labels,为什么需要执行完rpn_labels,再计算proposal_target_layer。还有tensorflow是顺序执行的,为什么这里要加上control_dependencies控制呢?谢谢

sigma-alpha-beta avatar Dec 07 '18 07:12 sigma-alpha-beta