gjy3035 / GCC-SFCN

This is the official code of spatial FCN in the paper Learning from Synthetic Data for Crowd Counting in the Wild [CVPR2019].
https://gjy3035.github.io/GCC-CL/
MIT License
160 stars 39 forks source link

IndexError happend in training #20

Open FanShuixing opened 5 years ago

FanShuixing commented 5 years ago

Hi,Thanks for your sharing.I met a problem as follows when i run train.py train.py:125: UserWarning: volatile was removed and now has no effect. Usewith torch.no_grad():instead. img = Variable(img, volatile=True).cuda() train.py:126: UserWarning: volatile was removed and now has no effect. Usewith torch.no_grad():instead. gt_map = Variable(gt_map, volatile=True).cuda() Traceback (most recent call last): File "train.py", line 205, in <module> main() File "train.py", line 81, in main validate(val_loader, net, epoch, restore_transform) File "train.py", line 141, in validate gt_count_tmp = gt_count[i_img] IndexError: index 1 is out of bounds for axis 0 with size 1

This happend in validate(),is there something wrong in this function? I have print the gt_count.shape,it equals to (1,),and pred_map.shape equals to (768,1024),and i don't understand why use gt_count_tmp=gt_count[0] in line 141 of train.py. Thanks for your reply.

2king2 commented 3 years ago

Hello, I also ran into this problem, I ask you to solve it? How'd it work out