import tensorflow as tf

            # 第二次[1,2,none,none]
            to_caffe = tf.transpose(bottom, [0, 3, 1, 2])
            # then force it to have channel 2
            #[1,2,none.none],将9个anchor的前景得分和背景得分分开
            # 第二次[1,18,none,none]
            reshaped = tf.reshape(to_caffe, tf.concat(axis=0, values=[[self._batch_size], [num_dim, -1], [input_shape[2]]]))
            # then swap the channel back
            # [1,none,none,2], 第一个none应该为（行*9）
            # 第二次[1,none,none,18]
            to_tf = tf.transpose(reshaped, [0, 2, 3, 1])
            return to_tf

    def _softmax_layer(self, bottom, name):
        if name == 'rpn_cls_prob_reshape':
            input_shape = tf.shape(bottom)

            # tf.reshape()中-1的应用，-1表示不知道该填什么数字合适的情况下，可以选择，由python通过原数组和其他的值推测出来
            # 每一行是1个anchor的前景、背景得分，先显示所有点产生的第一种anchor，然后是所有点产生的第二种anchor，........
            bottom_reshaped = tf.reshape(bottom, [-1, input_shape[-1]])
            reshaped_score = tf.nn.softmax(bottom_reshaped, name=name)
            return tf.reshape(reshaped_score, input_shape)  # [1,none,none,2]
        return tf.nn.softmax(bottom, name=name)

    def _proposal_top_layer(self, rpn_cls_prob, rpn_bbox_pred, name):
        with tf.variable_scope(name):
            rois, rpn_scores = tf.py_func(proposal_top_layer,
                                          [rpn_cls_prob, rpn_bbox_pred, self._im_info,
                                           self._feat_stride, self._anchors, self._num_anchors],
