Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
promisechen666 opened this issue Jan 8, 2020 · 1 comment

Comments

@promisechen666
Copy link

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
Copy link
Owner

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants