withtimesgo1115 / gradCAM-YOLOv3-pytorch

This repository contains key scripts for implementing gradient CAM algorithm for YOLO v3 model. The codes has been tested on pytorch 1.7.1.
MIT License
24 stars 6 forks source link

请问大佬们这个问题该怎么解决啊 #8

Closed Culturedcucumber closed 1 year ago

Culturedcucumber commented 1 year ago

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.") 请问这个该如何解决啊,感谢

withtimesgo1115 commented 1 year ago

print the result of kernel_size k and type(k) before this line to check the data type please

Culturedcucumber commented 1 year ago

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