I face the same issue…
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
<ipython-input-14-3fe681399c1a> in <module>()
1 t1 = time.time()
2 print(datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
----> 3 model_conv = train_model(model_conv, criterion, optimizer_conv,exp_lr_scheduler, num_epochs=10)
4 t2 = time.time()
5 print(datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
<ipython-input-8-c5340d5d5434> in train_model(model, criterion, optimizer, lr_scheduler, num_epochs)
49 loss = None
50 # for nets that have multiple outputs such as inception
---> 51 outputs = model(inputs)
52 if isinstance(outputs, tuple):
53 loss = sum((criterion(o,labels) for o in outputs))
/home/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py in __call__(self, *input, **kwargs)
204
205 def __call__(self, *input, **kwargs):
--> 206 result = self.forward(*input, **kwargs)
207 for hook in self._forward_hooks.values():
208 hook_result = hook(self, input, result)
/home/anaconda3/lib/python3.6/site-packages/torchvision/models/inception.py in forward(self, x)
72 x = x.clone()
73 x[0] = x[0] * (0.229 / 0.5) + (0.485 - 0.5) / 0.5
---> 74 x[1] = x[1] * (0.224 / 0.5) + (0.456 - 0.5) / 0.5
75 x[2] = x[2] * (0.225 / 0.5) + (0.406 - 0.5) / 0.5
76 # 299 x 299 x 3
/home/anaconda3/lib/python3.6/site-packages/torch/autograd/variable.py in __getitem__(self, key)
67 type(key.data).__name__ == 'ByteTensor'):
68 return MaskedSelect()(self, key)
---> 69 return Index(key)(self)
70
71 def __setitem__(self, key, value):
/home/anaconda3/lib/python3.6/site-packages/torch/autograd/_functions/tensor.py in forward(self, i)
14 def forward(self, i):
15 self.input_size = i.size()
---> 16 result = i.index(self.index)
17 self.mark_shared_storage((i, result))
18 return result
IndexError: index 1 is out of range for dimension 0 (of size 1)
What can I do?