C-3-Framework
C-3-Framework copied to clipboard
Dimension Error! SHHA!
Hi, thanks for your excellent works and discussion.
When I run the train.py for SHHA datasets, I got a dimension error(VGG net). But only happened when I run for SHHA datasets.
RuntimeError: The size of tensor a (376) must match the size of tensor b (377) at non-singleton dimension 1
Can you please give me a suggestion?
I think the preprocessing has some problems. Because some images still have the odd length or width. I find there are some images's original shape like [1024, 713]. These images may not be resize.
Use https://github.com/gjy3035/C-3-Framework/blob/python3.x/datasets/QNRF/preapre_QNRF.m 投process SHHA.
Cheers!
I have this same problem and I have been tried to run prepare_QNRF, but get an error which don't have annpoints function . Can u help me or provide prepared datasets
@muzishen https://mailnwpueducn-my.sharepoint.com/:f:/g/personal/gjy3035_mail_nwpu_edu_cn/EkxvOVJBVuxPsu75YfYhv9UBKRFNP7WgLdxXFMSeHGhXjQ?e=IdyAzA
@gjy3035 Hi ! Thanks for your timely reply. I tried the data set you provided and ran your project, but the same problem occurred. Has the SHHA been updated? I wonder if the SHHA you provided still has an odd scale
You can find the annpoints in preapre_SHHB.m. annPoints = image_info{1}.location; You can try to modify it.
你好,我使用prepare_SHHB.m文件对SHHA中的图像进行resize,发现并没有任何改变,仔细看应该的.m中的程序有问题。所以我直接把每个图像的size变成standard_size = [768,1024] ,然后density对应相乘长、宽前后的比值,请问这种做法会影响groundtruth准确性吗?
@ydlu 上海B自身尺寸就是768x1024,因此不会有任何变化. 量化后准确性基本不会变化。 @muzishen We will reproduce the generation of the density map from the dot map or points using conv layer. So we have no plan to provide the processed density data.
我是说SHHA中的图像尺寸有问题,我用prepare.m文件把SHHA中的图像做了处理,resize成[768,1024] 。
@ydlu 抱歉,看错了你的评论。使用prepare_QNRF.py去resize即可。参见:https://github.com/gjy3035/C-3-Framework/issues/54#issuecomment-563015061
which net do you use? find the net.py you use in ./models,:add shape = x.shape at the beginning of forward func and use: x = F.interpolate(x, size=[shape[2], shape[3]]) instead of : x = F.upsample(x,scale_factor=8)
I fixed this error with this solution.hope it will be useful for you.
Cheers!
Hello.Have you obtained the correct data set? Can you send me a copy? I have never used Matlab.. Thank you.
You can find the annpoints in preapre_SHHB.m. annPoints = image_info{1}.location; You can try to modify it.
Have you obtained the correct data set? Can you send me a copy? I have never used Matlab.. Thank you
@gjy3035 Hi ! Thanks for your timely reply. I tried the data set you provided and ran your project, but the same problem occurred. Has the SHHA been updated? I wonder if the SHHA you provided still has an odd scale
Have you obtained the correct data set? Can you send me a copy? I have never used Matlab.. Thank you
Hi, thanks for your excellent works and discussion.
When I run the train.py for SHHA datasets, I got a dimension error(VGG net). But only happened when I run for SHHA datasets.
RuntimeError: The size of tensor a (376) must match the size of tensor b (377) at non-singleton dimension 1
Can you please give me a suggestion?
Have you obtained the correct data set? Can you send me a copy? I have never used Matlab.. Thank you
Why do I still get an error when I directly use the SHHA dataset file in csv format provided by the author? RuntimeError: The size of tensor a (672) must match the size of tensor b (683) at non-singleton dimension 0