pretrained-models.pytorch icon indicating copy to clipboard operation
pretrained-models.pytorch copied to clipboard

InceptionV4 raises Exception

Open elcolie opened this issue 6 years ago • 1 comments

I would like to try InceptionV4 on small dataset. It is CIFAR-10. I instantiate the model and train by myself. And the Exception raises

model = InceptionV4()
for epoch in range(1, 1 + 1):
    train(model, 'cpu', trainloader, optimizer, epoch)
    test(model, 'cpu', testloader)

Error

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-173-522b35044551> in <module>
      1 for epoch in range(1, 1 + 1):
----> 2     train(model, 'cpu', trainloader, optimizer, epoch)
      3     test(model, 'cpu', testloader)

<ipython-input-96-08f1d330fdad> in train(model, device, train_loader, optimizer, epoch)
     37         data, target = data.to(device), target.to(device)
     38         optimizer.zero_grad()
---> 39         output = model(data)
     40         loss = F.nll_loss(output, target)
     41         loss.backward()

/opt/conda/lib/python3.6/site-packages/torch/nn/modules/module.py in __call__(self, *input, **kwargs)
    487             result = self._slow_forward(*input, **kwargs)
    488         else:
--> 489             result = self.forward(*input, **kwargs)
    490         for hook in self._forward_hooks.values():
    491             hook_result = hook(self, input, result)

~/work/exercise11/skeptic.py in forward(self, input)
    305 
    306     def forward(self, input):
--> 307         x = self.features(input)
    308         x = self.logits(x)
    309         return x

/opt/conda/lib/python3.6/site-packages/torch/nn/modules/module.py in __call__(self, *input, **kwargs)
    487             result = self._slow_forward(*input, **kwargs)
    488         else:
--> 489             result = self.forward(*input, **kwargs)
    490         for hook in self._forward_hooks.values():
    491             hook_result = hook(self, input, result)

/opt/conda/lib/python3.6/site-packages/torch/nn/modules/container.py in forward(self, input)
     90     def forward(self, input):
     91         for module in self._modules.values():
---> 92             input = module(input)
     93         return input
     94 

/opt/conda/lib/python3.6/site-packages/torch/nn/modules/module.py in __call__(self, *input, **kwargs)
    487             result = self._slow_forward(*input, **kwargs)
    488         else:
--> 489             result = self.forward(*input, **kwargs)
    490         for hook in self._forward_hooks.values():
    491             hook_result = hook(self, input, result)

~/work/exercise11/skeptic.py in forward(self, x)
    150 
    151     def forward(self, x):
--> 152         x0 = self.branch0(x)
    153         x1 = self.branch1(x)
    154         x2 = self.branch2(x)

/opt/conda/lib/python3.6/site-packages/torch/nn/modules/module.py in __call__(self, *input, **kwargs)
    487             result = self._slow_forward(*input, **kwargs)
    488         else:
--> 489             result = self.forward(*input, **kwargs)
    490         for hook in self._forward_hooks.values():
    491             hook_result = hook(self, input, result)

~/work/exercise11/skeptic.py in forward(self, x)
     46 
     47     def forward(self, x):
---> 48         x = self.conv(x)
     49         x = self.bn(x)
     50         x = self.relu(x)

/opt/conda/lib/python3.6/site-packages/torch/nn/modules/module.py in __call__(self, *input, **kwargs)
    487             result = self._slow_forward(*input, **kwargs)
    488         else:
--> 489             result = self.forward(*input, **kwargs)
    490         for hook in self._forward_hooks.values():
    491             hook_result = hook(self, input, result)

/opt/conda/lib/python3.6/site-packages/torch/nn/modules/conv.py in forward(self, input)
    318     def forward(self, input):
    319         return F.conv2d(input, self.weight, self.bias, self.stride,
--> 320                         self.padding, self.dilation, self.groups)
    321 
    322 

RuntimeError: std::exception

Any ideas?

elcolie avatar Jan 02 '19 12:01 elcolie

I think root case might be small size of given data. Please confirm whether I am correct or not.

elcolie avatar Jan 02 '19 12:01 elcolie