KeyError while attempting to prune yolov5 model
Hello,
I am trying to prune yolov5 model using Torch_Pruning. It fails with error message: KeyError: Conv2d(32, 64, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1))
Detailed Traceback:
Traceback (most recent call last):
File "models/prune_TP_git_issue.py", line 117, in
Attaching the prune_TP.py code. (a) save the code under models dir (b) download pre-trained model and place it under weights dir (c) invoke the code from the main dir as follows: $ python models/prune_TP_git_issue.py
Also attaching the logfile from this run. It looks like DG.module_to_node dictionary is not built correctly - it seems to have only 1 entry: ------------ BEGIN : DG.module_to_node --------------------- {Conv2d(512, 255, kernel_size=(1, 1), stride=(1, 1)): <Node: (model.24.m.2 (Conv2d(512, 255, kernel_size=(1, 1), stride=(1, 1))), None)>} ------------ END : DG.module_to_node ---------------------
I am also seeing the same issue and would be interested if you have found a solution.
Thanks.
Does somebody successfully pruned the yolov5 model ?
I am also facing the same issue. Has anyone found a solution yet?
Same here: KeyError: Conv2d(3, 32, kernel_size=(6, 6), stride=(2, 2), padding=(2, 2))
I think there are some unused modules in YOLO, which will not be traced during forwarding. I will check it!
Anyone able to fix the issue ? I am facing the same