midasklr / yolov5prune

553 stars 113 forks source link

TypeError: __init__() missing 4 required positional arguments: 'cv1out', 'cv2out', 'cv3out', and 'bottle_args' #77

Open HU-jin1620 opened 2 years ago

HU-jin1620 commented 2 years ago

from n params module arguments
Traceback (most recent call last): File "F:/yolov5_mask/master/prune.py", line 794, in test_prune(opt.data, File "F:/yolov5_mask/master/prune.py", line 452, in test_prune pruned_model = ModelPruned(maskbndict=maskbndict, cfg=pruned_yaml, ch=3).cuda() File "F:\yolov5_mask\master\models\yolo.py", line 250, in init self.model, self.save, self.from_to_map = parse_pruned_model(self.maskbndict, deepcopy(self.yaml), ch=[ch]) # model, savelist File "F:\yolov5_mask\master\models\yolo.py", line 711, in parse_prunedmodel m = nn.Sequential([m(args) for _ in range(n)]) if n > 1 else m(*args) # module TypeError: init() missing 4 required positional arguments: 'cv1out', 'cv2out', 'cv3out', and 'bottle_args'

参照本仓库的的项目在自己的代码上修改出现了如上错误,有大佬能提点意见吗

szwyx999 commented 2 years ago

我出现了和你一样的问题。但我是在稀疏训练->剪枝->微调后,再次稀疏训练微调的模型时粗错了。

Sa-UpWorld commented 2 years ago

,再次稀疏训练微调的模型时粗错了

请问解决了吗,我自己的程序将引用C3的部门换为C3Prune也出现这个错误

abirsince92 commented 1 year ago

I found this error after changing that referenced C3 to C3Prune in yolo.py file. m = nn.Sequential((m(args) for in range(n))) if n > 1 else m(*args) # module TypeError: C3Pruned.init() missing 2 required positional arguments: 'cv3out' and 'bottle_args' Pls kindly sort out this issue.

martin-buti commented 1 year ago

我出现了和你一样的问题。但我是在稀疏训练->剪枝->微调后,再次稀疏训练微调的模型时粗错了。

我也是这样的,请问你怎么解决的呀?