---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
<ipython-input-10-7484f8b2266d> in <module>
4
5 # Kernel
----> 6 model = InceptionModel(1, 2, 2, 0, 3, num_pred_classes=2)
7
8 model(X)
~/Documents/github/COMP4660-Assignment-1/submission/pytorch-timeseries/src/models/inception.py in __init__(self, num_blocks, in_channels, out_channels, bottleneck_channels, kernel_sizes, use_residuals, num_pred_classes)
62 )
63
---> 64 self.blocks = nn.Sequential(*[
65 InceptionBlock(in_channels=channels[i], out_channels=channels[i + 1],
66 residual=use_residuals[i], bottleneck_channels=bottleneck_channels[i],
~/Documents/github/COMP4660-Assignment-1/submission/pytorch-timeseries/src/models/inception.py in <listcomp>(.0)
63
64 self.blocks = nn.Sequential(*[
---> 65 InceptionBlock(in_channels=channels[i], out_channels=channels[i + 1],
66 residual=use_residuals[i], bottleneck_channels=bottleneck_channels[i],
67 kernel_size=kernel_sizes[i]) for i in range(num_blocks)
~/Documents/github/COMP4660-Assignment-1/submission/pytorch-timeseries/src/models/inception.py in __init__(self, in_channels, out_channels, residual, stride, bottleneck_channels, kernel_size)
112 # Conv1dSamePadding(in_channels=channels[1], out_channels=channels[1 + 1],
113 # kernel_size=kernel_size_s[1], stride=stride, bias=False)
--> 114 # print(2)
115 # Conv1dSamePadding(in_channels=channels[2], out_channels=channels[2 + 1],
116 # kernel_size=kernel_size_s[2], stride=stride, bias=False)
~/.local/lib/python3.8/site-packages/torch/nn/modules/conv.py in __init__(self, in_channels, out_channels, kernel_size, stride, padding, dilation, groups, bias, padding_mode)
248 padding_ = _single(padding)
249 dilation_ = _single(dilation)
--> 250 super(Conv1d, self).__init__(
251 in_channels, out_channels, kernel_size_, stride_, padding_, dilation_,
252 False, _single(0), groups, bias, padding_mode)
~/.local/lib/python3.8/site-packages/torch/nn/modules/conv.py in __init__(self, in_channels, out_channels, kernel_size, stride, padding, dilation, transposed, output_padding, groups, bias, padding_mode)
110 else:
111 self.register_parameter('bias', None)
--> 112 self.reset_parameters()
113
114 def reset_parameters(self) -> None:
~/.local/lib/python3.8/site-packages/torch/nn/modules/conv.py in reset_parameters(self)
113
114 def reset_parameters(self) -> None:
--> 115 init.kaiming_uniform_(self.weight, a=math.sqrt(5))
116 if self.bias is not None:
117 fan_in, _ = init._calculate_fan_in_and_fan_out(self.weight)
~/.local/lib/python3.8/site-packages/torch/nn/init.py in kaiming_uniform_(tensor, a, mode, nonlinearity)
374 fan = _calculate_correct_fan(tensor, mode)
375 gain = calculate_gain(nonlinearity, a)
--> 376 std = gain / math.sqrt(fan)
377 bound = math.sqrt(3.0) * std # Calculate uniform bounds from standard deviation
378 with torch.no_grad():
ZeroDivisionError: float division by zero