@bodokaiser,
my code is
transforms = transforms.Compose([
        transforms.CenterCrop(418),
        transforms.ToTensor(),
    ])
dset = datasets.ImageFolder(os.path.join('./data/'), transforms)
dset_loader = torch.utils.data.DataLoader(dset, batch_size=1)
inputs, classes = next(iter(dset_loader))

model_resnet18 = resnet18(pretrained=False)
input_test = Variable(inputs)
print(input_test.size(), input_test)
out = model_resnet18(input_test)

output of input_test.size() is torch.Size([1, 3, 418, 418])
And the complete error stack trace is:
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-4-b764430b1113> in <module>()
      2 input_test = Variable(torch.Tensor(input_np))
      3 print(input_test.size(), input_test)
----> 4 out = model_resnet18(input_test)
      5 print(out)

/usr/share/Anaconda2/lib/python2.7/site-packages/torch/nn/modules/module.pyc 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)

/usr/share/Anaconda2/lib/python2.7/site-packages/torchvision/models/resnet.pyc in forward(self, x)
    148         x = self.avgpool(x)
    149         x = x.view(x.size(0), -1)
--> 150         x = self.fc(x)
    151 
    152         return x

/usr/share/Anaconda2/lib/python2.7/site-packages/torch/nn/modules/module.pyc 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)

/usr/share/Anaconda2/lib/python2.7/site-packages/torch/nn/modules/linear.pyc in forward(self, input)
     52             return self._backend.Linear()(input, self.weight)
     53         else:
---> 54             return self._backend.Linear()(input, self.weight, self.bias)
     55 
     56     def __repr__(self):

/usr/share/Anaconda2/lib/python2.7/site-packages/torch/nn/_functions/linear.pyc in forward(self, input, weight, bias)
      8         self.save_for_backward(input, weight, bias)
      9         output = input.new(input.size(0), weight.size(0))
---> 10         output.addmm_(0, 1, input, weight.t())
     11         if bias is not None:
     12             # cuBLAS doesn't support 0 strides in sger, so we can't use expand

RuntimeError: size mismatch, m1: [1 x 2048], m2: [512 x 1000] at /b/wheel/pytorch-src/torch/lib/TH/generic/THTensorMath.c:1229