princeton-vl / CornerNet-Lite

BSD 3-Clause "New" or "Revised" License
1.78k stars 431 forks source link

dist = tag_mean.unsqueeze(1) - tag_mean.unsqueeze(2) #115

Closed cqray1990 closed 4 years ago

cqray1990 commented 4 years ago

dist = tag_mean.unsqueeze(1) - tag_mean.unsqueeze(2)

when the code run here,it raised : dist = tag_mean.unsqueeze(1) - tag_mean.unsqueeze(2) RuntimeError: Dimension out of range (expected to be in range of [-2, 1], but got 2)

can you help me? Thank you!

berther commented 4 years ago

replace the two lines tag0 = tag0[:].squeeze() tag1 = tag1[:].squeeze() with tag0 = torch.squeeze(tag0,dim=2) tag1 = torch.squeeze(tag1,dim=2)

dist = tag_mean.unsqueeze(1) - tag_mean.unsqueeze(2)

when the code run here,it raised : dist = tag_mean.unsqueeze(1) - tag_mean.unsqueeze(2) RuntimeError: Dimension out of range (expected to be in range of [-2, 1], but got 2)

can you help me? Thank you!

replace the two lines tag0 = tag0[:].squeeze() tag1 = tag1[:].squeeze() with tag0 = torch.squeeze(tag0,dim=2) tag1 = torch.squeeze(tag1,dim=2)

cqray1990 commented 4 years ago

tag0 is two dimension,does it works?

cqray1990 commented 4 years ago

tag0 is two dimension,does it works?@berther

berther commented 4 years ago

tag0 is two dimension,does it works?@berther

After the two lines,If tag0 and tag1 are two dimension,it works.Is your batchsize equal to 1?

cqray1990 commented 4 years ago

Yes,i set batch_size=1

cqray1990 commented 4 years ago

Yes,i set batch_size=1,@berther

cqray1990 commented 4 years ago

but i get another problem,even i set batch_size=1,it also raise RuntimeError: CUDA out of memory. Tried to allocate 6.75 MiB (GPU 0; 3.94 GiB total capacity; 1.50 GiB already allocated; 23.00 MiB free; 49.10 MiB cached),it is wired??