---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
<ipython-input-27-cb3f6be760ae> in <module>
11
12 model = UNet2D(in_channels=n_channels, residual=True).to(device)
---> 13 model.forward(X)
unet/unet.py in forward(self, x)
120 skip_connections, encoding = self.encoder(x)
121 encoding = self.bottom_block(encoding)
--> 122 x = self.decoder(skip_connections, encoding)
123 if self.monte_carlo_layer is not None:
124 x = self.monte_carlo_layer(x)
torch/nn/modules/module.py in _call_impl(self, *input, **kwargs)
725 result = self._slow_forward(*input, **kwargs)
726 else:
--> 727 result = self.forward(*input, **kwargs)
728 for hook in itertools.chain(
729 _global_forward_hooks.values(),
unet/decoding.py in forward(self, skip_connections, x)
59 zipped = zip(reversed(skip_connections), self.decoding_blocks)
60 for skip_connection, decoding_block in zipped:
---> 61 x = decoding_block(skip_connection, x)
62 return x
63
torch/nn/modules/module.py in _call_impl(self, *input, **kwargs)
725 result = self._slow_forward(*input, **kwargs)
726 else:
--> 727 result = self.forward(*input, **kwargs)
728 for hook in itertools.chain(
729 _global_forward_hooks.values(),
unet/decoding.py in forward(self, skip_connection, x)
129 x = self.upsample(x)
130 skip_connection = self.center_crop(skip_connection, x)
--> 131 x = torch.cat((skip_connection, x), dim=CHANNELS_DIMENSION)
132 if self.residual:
133 connection = self.conv_residual(x)
RuntimeError: Sizes of tensors must match except in dimension 2. Got 62 and 63 (The offending index is 0)
Please document how to train and predict, particularly regarding input dimensions.
Minimal failing example
Error: