cardwing / Codes-for-Lane-Detection

Learning Lightweight Lane Detection CNNs by Self Attention Distillation (ICCV 2019)
MIT License
1.05k stars 333 forks source link

about ERFnet ,downsample #159

Closed noobliang closed 5 years ago

noobliang commented 5 years ago

why a tensor [2,16,104,485] , by Downsampleblock , some to be [2,48,52,243]. some to be [2,16,52,242] ,can't torch.cat ?
output = torch.cat([self.conv(input), self.pool(input)], 1) . RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension 1. Got 242 and 243 in dimension 3 at /pytorch/torch/lib/THC/generic/THCTensorMath.cu:111 torch.Size([2, 48, 52, 243]), torch.Size([2, 16, 52, 242])

noobliang commented 5 years ago

why a tensor [2,16,104,485] , by Downsampleblock , some to be [2,48,52,243]. some to be [2,16,52,242] ,can't torch.cat ? output = torch.cat([self.conv(input), self.pool(input)], 1) . RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension 1. Got 242 and 243 in dimension 3 at /pytorch/torch/lib/THC/generic/THCTensorMath.cu:111 torch.Size([2, 48, 52, 243]), torch.Size([2, 16, 52, 242])

sorrry , i found my image height has problem

yongweixie commented 4 years ago

为什么由Downsampleblock提供的张量[2,16,104,485],有些为[2,48,52,243]。有些是[2,16,52,242],可以不使用torch.cat吗? output = torch.cat([self.conv(input), self.pool(input)], 1) . RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension 1. Got 242 and 243 in dimension 3 at /pytorch/torch/lib/THC/generic/THCTensorMath.cu:111 torch.Size([2, 48, 52, 243]), torch.Size([2, 16, 52, 242])

抱歉,我发现我的图像高度有问题

I have the same question ,I should change the input image's size ?

kaishijeng commented 4 years ago

@noobliang

How do you resolve this issue? I got the same problem. What is image height I need to use?

Thanks,