N
N
Nikita Rubinkovskiy2018-10-09 17:42:04
Python
Nikita Rubinkovskiy, 2018-10-09 17:42:04

What does the "IndexError: list index out of range" error mean?

Hello.
I'm trying to test a neural network model for a project,
https://github.com/torralba-lab/im2recipe-Pytorch
but I get an error when testing

~/im2recipe-Pytorch$ python test.py --no-cuda --model_path=snapshots/model_e220_v-4.700.pth.tar
Downloading: "https://download.pytorch.org/models/resnet50-19c8e357.pth" to /home/rabbit/.torch/models/resnet50-19c8e357.pth
100%|████████████████████████| 102502400/102502400 [00:33<00:00, 3027106.84it/s]
=> loading checkpoint 'snapshots/model_e220_v-4.700.pth.tar'
=> loaded checkpoint 'snapshots/model_e220_v-4.700.pth.tar' (epoch 220)
/home/rabbit/.local/lib/python2.7/site-packages/torchvision/transforms/transforms.py:188: UserWarning: The use of the transforms.Scale transform is deprecated, please use transforms.Resize instead.
  "please use transforms.Resize instead.")
Test loader prepared.
test.py:96: UserWarning: volatile was removed and now has no effect. Use with torch.no_grad(): instead.
  v = torch.autograd.Variable(input[j], volatile=True)
test.py:100: UserWarning: volatile was removed and now has no effect. Use with torch.no_grad(): instead.
  v = torch.autograd.Variable(target[j], volatile=True)
Traceback (most recent call last):
  File "test.py", line 176, in <module>
    main()
  File "test.py", line 80, in main
    test(test_loader, model, criterion)
  File "test.py", line 104, in test
    output = model(input_var[0],input_var[1], input_var[2], input_var[3], input_var[4])
IndexError: list index out of range

What's the matter?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question