Closed cqray1990 closed 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)
tag0 is two dimension,does it works?
tag0 is two dimension,does it works?@berther
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?
Yes,i set batch_size=1
Yes,i set batch_size=1,@berther
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??
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!