1.m_ = nn.Sequential(*(m(*args) for _ in range(n))) if n > 1 else m(*args) # module
TypeError: __init__() takes from 2 to 3 positional arguments but 4 were given
2.报错原因:
tasks.py中加了两个CBAM!如上图
解决办法:去掉if m in ()中的CBAM!
在`tasks.py`中引入两个CBAM时,出现TypeError。解决方法是移除if语句中多余的CBAM,确保`__init__`函数接受2到3个位置参数。
1.m_ = nn.Sequential(*(m(*args) for _ in range(n))) if n > 1 else m(*args) # module
TypeError: __init__() takes from 2 to 3 positional arguments but 4 were given
2.报错原因:
tasks.py中加了两个CBAM!如上图
解决办法:去掉if m in ()中的CBAM!
2135
1220
1732
5545