- try:
- # classes
- node.out_node(1).shape = np.array([rois_num], dtype=np.int64)
- # scores
- node.out_node(2).shape = np.array([rois_num], dtype=np.int64)
- # batch_ids
- node.out_node(3).shape = np.array([rois_num], dtype=np.int64)
- except Exception as ex:
- print(ex)
+ # classes, scores, batch indices
+ for port_ind in range(1, 4):
+ if not node.out_port(port_ind).disconnected():
+ node.out_port(port_ind).data.set_shape(int64_array([rois_num]))