xhp-hust-2018-2011 / S-DCNet

Implementaion of S-DCNet (ICCV 2019)
MIT License
133 stars 27 forks source link

RuntimeError: The expanded size of the tensor (9) must match the existing size (8) at non-singleton dimension 3. #13

Open promisechen666 opened 4 years ago

promisechen666 commented 4 years ago

cd:root/S-DCNet-master/Network/merge_func.PY/ line23 for rx in range(rate): for ry in range(rate): cl2h[:,:,rx::rate,ry::rate] = clow*norm
Report an error at this location, 【RuntimeError: The expanded size of the tensor (9) must match the existing size (8) at non-singleton dimension 3. Target sizes: [1, 1, 6, 9]. Tensor sizes: [5, 8]】 Can you tell me why?

xhp-hust-2018-2011 commented 4 years ago

This maybe due to the improper zero-padding. Since the maximum downsample rate is 64, you must ensure the size of input images to be divisible by 64. This zero padding is ensured in the "load_data_V2.py" line 114 as follows: sample['image'],sample['density_map'] = get_pad(sample['image'],DIV=64),get_pad(sample['density_map'],DIV=64)