Closed Culturedcucumber closed 1 year ago
print the result of kernel_size k and type(k) before this line to check the data type please
print the result of kernel_size k and type(k) before this line to check the data type please
Thx! this problem has been solved
TypeError: conv2d filter size must be int type. 我查看了代码中这一行的错误,好像是卷积核的数据类型出错了(不确定) if isinstance(k, int): modules.add_module("Conv2d", nn.Conv2d(in_channels=output_filters[-1], out_channels=filters, kernel_size=k, stride=stride, padding=k // 2 if mdef["pad"] else 0, bias=not bn)) else: raise TypeError("conv2d filter size must be int type.") 请问这个该如何解决啊,感谢