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

IndexError happend in training #20

Open
FanShuixing opened this issue May 15, 2019 · 1 comment
Open

IndexError happend in training #20

FanShuixing opened this issue May 15, 2019 · 1 comment

Comments

@FanShuixing
Copy link

FanShuixing commented May 15, 2019

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.

@2king2
Copy link

2king2 commented May 11, 2021

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

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