Print not work in mxnet


#1

I want to print gt_boxes here

            # for each ground-truth, find the best matching anchor within the particular grid
            # for instance, center of object 1 reside in grid (3, 4) in (16, 16) feature map
            # then only the anchor in (3, 4) is going to be matched
            gtx, gty, gtw, gth = self.bbox2center(gt_boxes)
            shift_gt_boxes = nd.concat(gtx * 0, gty * 0, gtw, gth, dim=-1)
            anchor_boxes = nd.concat(0 * all_anchors, all_anchors, dim=-1)  # zero center anchors
            shift_anchor_boxes = self.bbox2corner(anchor_boxes)
            ious = nd.contrib.box_iou(shift_anchor_boxes, shift_gt_boxes).transpose((1, 0, 2))
            # real value is required to process, convert to Numpy

for example. but the nothing will print when run the code ?
how to print it?


#2

Hi @Alpha,

I just tried this and I was able to print out the values of gt_boxes at this point. You can modify the source code and add a print statement to do this (i.e. print(gt_boxes.asnumpy())) or even better you can add a break point in the code at this point, and use your debugger to inspect the values.


#3

If you are trying to print some var in network, make sure you disable net.hybridize(), otherwise it’s symbol not pure ndarray