ZJULearning / ttfnet

Apache License 2.0
481 stars 96 forks source link

Questions regarding giou loss. #11

Open wms2537 opened 4 years ago

wms2537 commented 4 years ago

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)

liuzili97 commented 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].

wms2537 commented 4 years ago

but you sliced them with pos_mask, which has the same shape with weight. Isn't it shoud be multiplied?

liuzili97 commented 4 years ago

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'.

wms2537 commented 4 years ago

sorry, I'm new in pytorch. Looks like slicing in pytorch works differently with mxnet.

torleivf commented 4 years ago

image Do you know whether this is my fault, caused by input, or a bug?

liuzili97 commented 4 years ago

image 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.