I want to double the size of the input so I am using maxUnpool2d
Input size: 1x16x16
Desired size: 1x32x32
I write this:
nnFunctions.max_unpool2d(self.resnet.layer4(x),kernel_size=(2,2),stride=(2,2))
But I get the following error:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
in ()
----> 1 net=train(train_loader,net,1,410)
<ipython-input-26-0904d8b22f1a> in train(train_loader, net, epochs, total_samples)
15
16 # forward + backward + optimize
---> 17 outputs = net(inputs)
18 loss = criterion(outputs, labels)
19 loss.backward()
/home/sarthak/anaconda2/lib/python2.7/site-packages/torch/nn/modules/module.pyc in __call__(self, *input, **kwargs)
208
209 def __call__(self, *input, **kwargs):
--> 210 result = self.forward(*input, **kwargs)
211 for hook in self._forward_hooks.values():
212 hook_result = hook(self, input, result)
<ipython-input-20-808a1f82a64b> in forward(self, x)
17 x=self.resnet.layer2(x)
18 x=self.resnet.layer3(x)
---> 19 x=nnFunctions.max_unpool2d(self.resnet.layer4(x),kernel_size=(2,2),stride=(2,2))
20 x=self.custom_net(x)
21 return x
TypeError: max_unpool2d() takes at least 3 arguments (3 given)