I use the same file in two Google colab, ones can run, but another get a TypeError, which is 'add_module() missing 1 required positional argument: ‘module’.
The following code contains the add_module()
# self.straight.add_module(nn.BatchNorm1d(num_features=out_channel))
self.straight.add_module(nn.ReLU())

length = duration - sum(kernels) + len(kernels)  # 卷积结束后作池差
self.straight.add_module(prefix+"Pooling",
                                 nn.MaxPool1d(kernel_size=length))


image1318×1035 139 KB