Open wms2537 opened 4 years ago
They are 4-dim tensor. The shape of weight/pred/target is [batch_size, H, W] / [batch_size, H, W, 4] / [batch_size, H, W, 4].
but you sliced them with pos_mask, which has the same shape with weight. Isn't it shoud be multiplied?
The shape of pos_mask is [batch_size, H, W]. After slicing, the shape of weight is [pos_mask.sum()], and the shape of bboxes1/bboxes2 is [pos_mask.sum(), 4]. I don't get what you mean ’multiplied'.
sorry, I'm new in pytorch. Looks like slicing in pytorch works differently with mxnet.
Do you know whether this is my fault, caused by input, or a bug?
Do you know whether this is my fault, caused by input, or a bug?
Hi, it is caused by the input. The bboxes should be float32.
Isn't the output of weight, bboxes1, and bboxes2 after slicing with pos_mask a 5-dim tensor? After reshape, it can't fit into memory.
weight = weight[pos_mask].float() bboxes1 = pred[pos_mask].view(-1, 4) bboxes2 = target[pos_mask].view(-1, 4)