Skip to content

build_whole_network中的代码请教 #18

@sigma-alpha-beta

Description

@sigma-alpha-beta
        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控制呢?谢谢

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions