GCC-SFCN icon indicating copy to clipboard operation
GCC-SFCN copied to clipboard

IndexError happend in training

Open FanShuixing opened this issue 5 years ago • 1 comments

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. Use with 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.

FanShuixing avatar May 15 '19 03:05 FanShuixing

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

2king2 avatar May 11 '21 07:05 2king2