openvinotoolkit / nncf

Neural Network Compression Framework for enhanced OpenVINO™ inference
Apache License 2.0
951 stars 237 forks source link

[yolov5s] conv input channel mismatch after filter prune #851

Open justpi opened 3 years ago

justpi commented 3 years ago

I just started using NNCF and I used NNCF to do filter pruning on Yolov5s. When I trained the model according to the steps in Useage, the model could be trained or saved using torch. save, but it would report an error when exporting it to ONNX format.Here is my configuration file:

{
    "input_info":[
        {
            "sample_size": [24, 3, 640, 640],
            "type": "float",
        }
    ],
    "target_device":"GPU",
    "compression":[
        {
            "algorithm":"filter_pruning",
            "initializer":{
                "batchnorm_adaptation":{
                    "num_bn_adaptation_samples":2048
                }
            },
            "pruning_init":0.04,
            "params":{
                "schedule":"baseline",
                "pruning_target":0.5,
                "num_init_steps":0,
                "pruning_steps":10,
                "weight_importance":"L2",
                "all_weights":false,
                "prune_first_conv":false,
                "prune_last_conv":false,
                "prune_downsample_convs":true,
                "prune_batch_norms":true,
                "zero_grad":true
            },
            "ignored_scopes":[
            ]
        }
    ]
}

this is the output and error:

Starting training for 1 epochs...
WARNING:nncf:Graphviz is not installed - only the .dot model visualization format will be used. Install pygraphviz into your Python environment and graphviz system-wide to enable PNG rendering.
INFO:nncf:Wrapping module Model/Sequential[model]/Focus[0]/Conv[conv]/Conv2d[conv] by Model/Sequential[model]/Focus[0]/Conv[conv]/NNCFConv2d[conv]
INFO:nncf:Wrapping module Model/Sequential[model]/Conv[1]/Conv2d[conv] by Model/Sequential[model]/Conv[1]/NNCFConv2d[conv]
INFO:nncf:Wrapping module Model/Sequential[model]/C3[2]/Conv[cv1]/Conv2d[conv] by Model/Sequential[model]/C3[2]/Conv[cv1]/NNCFConv2d[conv]
INFO:nncf:Wrapping module Model/Sequential[model]/C3[2]/Conv[cv2]/Conv2d[conv] by Model/Sequential[model]/C3[2]/Conv[cv2]/NNCFConv2d[conv]
INFO:nncf:Wrapping module Model/Sequential[model]/C3[2]/Conv[cv3]/Conv2d[conv] by Model/Sequential[model]/C3[2]/Conv[cv3]/NNCFConv2d[conv]
INFO:nncf:Wrapping module Model/Sequential[model]/C3[2]/Sequential[m]/Bottleneck[0]/Conv[cv1]/Conv2d[conv] by Model/Sequential[model]/C3[2]/Sequential[m]/Bottleneck[0]/Conv[cv1]/NNCFConv2d[conv]
INFO:nncf:Wrapping module Model/Sequential[model]/C3[2]/Sequential[m]/Bottleneck[0]/Conv[cv2]/Conv2d[conv] by Model/Sequential[model]/C3[2]/Sequential[m]/Bottleneck[0]/Conv[cv2]/NNCFConv2d[conv]
INFO:nncf:Wrapping module Model/Sequential[model]/Conv[3]/Conv2d[conv] by Model/Sequential[model]/Conv[3]/NNCFConv2d[conv]
INFO:nncf:Wrapping module Model/Sequential[model]/C3[4]/Conv[cv1]/Conv2d[conv] by Model/Sequential[model]/C3[4]/Conv[cv1]/NNCFConv2d[conv]
INFO:nncf:Wrapping module Model/Sequential[model]/C3[4]/Conv[cv2]/Conv2d[conv] by Model/Sequential[model]/C3[4]/Conv[cv2]/NNCFConv2d[conv]
INFO:nncf:Wrapping module Model/Sequential[model]/C3[4]/Conv[cv3]/Conv2d[conv] by Model/Sequential[model]/C3[4]/Conv[cv3]/NNCFConv2d[conv]
INFO:nncf:Wrapping module Model/Sequential[model]/C3[4]/Sequential[m]/Bottleneck[0]/Conv[cv1]/Conv2d[conv] by Model/Sequential[model]/C3[4]/Sequential[m]/Bottleneck[0]/Conv[cv1]/NNCFConv2d[conv]
INFO:nncf:Wrapping module Model/Sequential[model]/C3[4]/Sequential[m]/Bottleneck[0]/Conv[cv2]/Conv2d[conv] by Model/Sequential[model]/C3[4]/Sequential[m]/Bottleneck[0]/Conv[cv2]/NNCFConv2d[conv]
INFO:nncf:Wrapping module Model/Sequential[model]/C3[4]/Sequential[m]/Bottleneck[1]/Conv[cv1]/Conv2d[conv] by Model/Sequential[model]/C3[4]/Sequential[m]/Bottleneck[1]/Conv[cv1]/NNCFConv2d[conv]
INFO:nncf:Wrapping module Model/Sequential[model]/C3[4]/Sequential[m]/Bottleneck[1]/Conv[cv2]/Conv2d[conv] by Model/Sequential[model]/C3[4]/Sequential[m]/Bottleneck[1]/Conv[cv2]/NNCFConv2d[conv]
INFO:nncf:Wrapping module Model/Sequential[model]/C3[4]/Sequential[m]/Bottleneck[2]/Conv[cv1]/Conv2d[conv] by Model/Sequential[model]/C3[4]/Sequential[m]/Bottleneck[2]/Conv[cv1]/NNCFConv2d[conv]
INFO:nncf:Wrapping module Model/Sequential[model]/C3[4]/Sequential[m]/Bottleneck[2]/Conv[cv2]/Conv2d[conv] by Model/Sequential[model]/C3[4]/Sequential[m]/Bottleneck[2]/Conv[cv2]/NNCFConv2d[conv]
INFO:nncf:Wrapping module Model/Sequential[model]/Conv[5]/Conv2d[conv] by Model/Sequential[model]/Conv[5]/NNCFConv2d[conv]
INFO:nncf:Wrapping module Model/Sequential[model]/C3[6]/Conv[cv1]/Conv2d[conv] by Model/Sequential[model]/C3[6]/Conv[cv1]/NNCFConv2d[conv]
INFO:nncf:Wrapping module Model/Sequential[model]/C3[6]/Conv[cv2]/Conv2d[conv] by Model/Sequential[model]/C3[6]/Conv[cv2]/NNCFConv2d[conv]
INFO:nncf:Wrapping module Model/Sequential[model]/C3[6]/Conv[cv3]/Conv2d[conv] by Model/Sequential[model]/C3[6]/Conv[cv3]/NNCFConv2d[conv]
INFO:nncf:Wrapping module Model/Sequential[model]/C3[6]/Sequential[m]/Bottleneck[0]/Conv[cv1]/Conv2d[conv] by Model/Sequential[model]/C3[6]/Sequential[m]/Bottleneck[0]/Conv[cv1]/NNCFConv2d[conv]
INFO:nncf:Wrapping module Model/Sequential[model]/C3[6]/Sequential[m]/Bottleneck[0]/Conv[cv2]/Conv2d[conv] by Model/Sequential[model]/C3[6]/Sequential[m]/Bottleneck[0]/Conv[cv2]/NNCFConv2d[conv]
INFO:nncf:Wrapping module Model/Sequential[model]/C3[6]/Sequential[m]/Bottleneck[1]/Conv[cv1]/Conv2d[conv] by Model/Sequential[model]/C3[6]/Sequential[m]/Bottleneck[1]/Conv[cv1]/NNCFConv2d[conv]
INFO:nncf:Wrapping module Model/Sequential[model]/C3[6]/Sequential[m]/Bottleneck[1]/Conv[cv2]/Conv2d[conv] by Model/Sequential[model]/C3[6]/Sequential[m]/Bottleneck[1]/Conv[cv2]/NNCFConv2d[conv]
INFO:nncf:Wrapping module Model/Sequential[model]/C3[6]/Sequential[m]/Bottleneck[2]/Conv[cv1]/Conv2d[conv] by Model/Sequential[model]/C3[6]/Sequential[m]/Bottleneck[2]/Conv[cv1]/NNCFConv2d[conv]
INFO:nncf:Wrapping module Model/Sequential[model]/C3[6]/Sequential[m]/Bottleneck[2]/Conv[cv2]/Conv2d[conv] by Model/Sequential[model]/C3[6]/Sequential[m]/Bottleneck[2]/Conv[cv2]/NNCFConv2d[conv]
INFO:nncf:Wrapping module Model/Sequential[model]/Conv[7]/Conv2d[conv] by Model/Sequential[model]/Conv[7]/NNCFConv2d[conv]
INFO:nncf:Wrapping module Model/Sequential[model]/SPP[8]/Conv[cv1]/Conv2d[conv] by Model/Sequential[model]/SPP[8]/Conv[cv1]/NNCFConv2d[conv]
INFO:nncf:Wrapping module Model/Sequential[model]/SPP[8]/Conv[cv2]/Conv2d[conv] by Model/Sequential[model]/SPP[8]/Conv[cv2]/NNCFConv2d[conv]
INFO:nncf:Wrapping module Model/Sequential[model]/C3[9]/Conv[cv1]/Conv2d[conv] by Model/Sequential[model]/C3[9]/Conv[cv1]/NNCFConv2d[conv]
INFO:nncf:Wrapping module Model/Sequential[model]/C3[9]/Conv[cv2]/Conv2d[conv] by Model/Sequential[model]/C3[9]/Conv[cv2]/NNCFConv2d[conv]
INFO:nncf:Wrapping module Model/Sequential[model]/C3[9]/Conv[cv3]/Conv2d[conv] by Model/Sequential[model]/C3[9]/Conv[cv3]/NNCFConv2d[conv]
INFO:nncf:Wrapping module Model/Sequential[model]/C3[9]/Sequential[m]/Bottleneck[0]/Conv[cv1]/Conv2d[conv] by Model/Sequential[model]/C3[9]/Sequential[m]/Bottleneck[0]/Conv[cv1]/NNCFConv2d[conv]
INFO:nncf:Wrapping module Model/Sequential[model]/C3[9]/Sequential[m]/Bottleneck[0]/Conv[cv2]/Conv2d[conv] by Model/Sequential[model]/C3[9]/Sequential[m]/Bottleneck[0]/Conv[cv2]/NNCFConv2d[conv]
INFO:nncf:Wrapping module Model/Sequential[model]/Conv[10]/Conv2d[conv] by Model/Sequential[model]/Conv[10]/NNCFConv2d[conv]
INFO:nncf:Wrapping module Model/Sequential[model]/C3[13]/Conv[cv1]/Conv2d[conv] by Model/Sequential[model]/C3[13]/Conv[cv1]/NNCFConv2d[conv]
INFO:nncf:Wrapping module Model/Sequential[model]/C3[13]/Conv[cv2]/Conv2d[conv] by Model/Sequential[model]/C3[13]/Conv[cv2]/NNCFConv2d[conv]
INFO:nncf:Wrapping module Model/Sequential[model]/C3[13]/Conv[cv3]/Conv2d[conv] by Model/Sequential[model]/C3[13]/Conv[cv3]/NNCFConv2d[conv]
INFO:nncf:Wrapping module Model/Sequential[model]/C3[13]/Sequential[m]/Bottleneck[0]/Conv[cv1]/Conv2d[conv] by Model/Sequential[model]/C3[13]/Sequential[m]/Bottleneck[0]/Conv[cv1]/NNCFConv2d[conv]
INFO:nncf:Wrapping module Model/Sequential[model]/C3[13]/Sequential[m]/Bottleneck[0]/Conv[cv2]/Conv2d[conv] by Model/Sequential[model]/C3[13]/Sequential[m]/Bottleneck[0]/Conv[cv2]/NNCFConv2d[conv]
INFO:nncf:Wrapping module Model/Sequential[model]/Conv[14]/Conv2d[conv] by Model/Sequential[model]/Conv[14]/NNCFConv2d[conv]
INFO:nncf:Wrapping module Model/Sequential[model]/C3[17]/Conv[cv1]/Conv2d[conv] by Model/Sequential[model]/C3[17]/Conv[cv1]/NNCFConv2d[conv]
INFO:nncf:Wrapping module Model/Sequential[model]/C3[17]/Conv[cv2]/Conv2d[conv] by Model/Sequential[model]/C3[17]/Conv[cv2]/NNCFConv2d[conv]
INFO:nncf:Wrapping module Model/Sequential[model]/C3[17]/Conv[cv3]/Conv2d[conv] by Model/Sequential[model]/C3[17]/Conv[cv3]/NNCFConv2d[conv]
INFO:nncf:Wrapping module Model/Sequential[model]/C3[17]/Sequential[m]/Bottleneck[0]/Conv[cv1]/Conv2d[conv] by Model/Sequential[model]/C3[17]/Sequential[m]/Bottleneck[0]/Conv[cv1]/NNCFConv2d[conv]
INFO:nncf:Wrapping module Model/Sequential[model]/C3[17]/Sequential[m]/Bottleneck[0]/Conv[cv2]/Conv2d[conv] by Model/Sequential[model]/C3[17]/Sequential[m]/Bottleneck[0]/Conv[cv2]/NNCFConv2d[conv]
INFO:nncf:Wrapping module Model/Sequential[model]/Conv[18]/Conv2d[conv] by Model/Sequential[model]/Conv[18]/NNCFConv2d[conv]
INFO:nncf:Wrapping module Model/Sequential[model]/C3[20]/Conv[cv1]/Conv2d[conv] by Model/Sequential[model]/C3[20]/Conv[cv1]/NNCFConv2d[conv]
INFO:nncf:Wrapping module Model/Sequential[model]/C3[20]/Conv[cv2]/Conv2d[conv] by Model/Sequential[model]/C3[20]/Conv[cv2]/NNCFConv2d[conv]
INFO:nncf:Wrapping module Model/Sequential[model]/C3[20]/Conv[cv3]/Conv2d[conv] by Model/Sequential[model]/C3[20]/Conv[cv3]/NNCFConv2d[conv]
INFO:nncf:Wrapping module Model/Sequential[model]/C3[20]/Sequential[m]/Bottleneck[0]/Conv[cv1]/Conv2d[conv] by Model/Sequential[model]/C3[20]/Sequential[m]/Bottleneck[0]/Conv[cv1]/NNCFConv2d[conv]
INFO:nncf:Wrapping module Model/Sequential[model]/C3[20]/Sequential[m]/Bottleneck[0]/Conv[cv2]/Conv2d[conv] by Model/Sequential[model]/C3[20]/Sequential[m]/Bottleneck[0]/Conv[cv2]/NNCFConv2d[conv]
INFO:nncf:Wrapping module Model/Sequential[model]/Conv[21]/Conv2d[conv] by Model/Sequential[model]/Conv[21]/NNCFConv2d[conv]
INFO:nncf:Wrapping module Model/Sequential[model]/C3[23]/Conv[cv1]/Conv2d[conv] by Model/Sequential[model]/C3[23]/Conv[cv1]/NNCFConv2d[conv]
INFO:nncf:Wrapping module Model/Sequential[model]/C3[23]/Conv[cv2]/Conv2d[conv] by Model/Sequential[model]/C3[23]/Conv[cv2]/NNCFConv2d[conv]
INFO:nncf:Wrapping module Model/Sequential[model]/C3[23]/Conv[cv3]/Conv2d[conv] by Model/Sequential[model]/C3[23]/Conv[cv3]/NNCFConv2d[conv]
INFO:nncf:Wrapping module Model/Sequential[model]/C3[23]/Sequential[m]/Bottleneck[0]/Conv[cv1]/Conv2d[conv] by Model/Sequential[model]/C3[23]/Sequential[m]/Bottleneck[0]/Conv[cv1]/NNCFConv2d[conv]
INFO:nncf:Wrapping module Model/Sequential[model]/C3[23]/Sequential[m]/Bottleneck[0]/Conv[cv2]/Conv2d[conv] by Model/Sequential[model]/C3[23]/Sequential[m]/Bottleneck[0]/Conv[cv2]/NNCFConv2d[conv]
INFO:nncf:Wrapping module Model/Sequential[model]/Detect[24]/ModuleList[m]/Conv2d[0] by Model/Sequential[model]/Detect[24]/ModuleList[m]/NNCFConv2d[0]
INFO:nncf:Wrapping module Model/Sequential[model]/Detect[24]/ModuleList[m]/Conv2d[1] by Model/Sequential[model]/Detect[24]/ModuleList[m]/NNCFConv2d[1]
INFO:nncf:Wrapping module Model/Sequential[model]/Detect[24]/ModuleList[m]/Conv2d[2] by Model/Sequential[model]/Detect[24]/ModuleList[m]/NNCFConv2d[2]
INFO:nncf:Creating compression algorithm: filter_pruning
INFO:nncf:Group of nodes [Model/Sequential[model]/Detect[24]/ModuleList[m]/NNCFConv2d[0]] can't be pruned, because some nodes should't be pruned, error messages for this nodes: Ignored adding Weight Pruner in: Model/Sequential[model]/Detect[24]/ModuleList[m]/NNCFConv2d[0]
INFO:nncf:Group of nodes [Model/Sequential[model]/Detect[24]/ModuleList[m]/NNCFConv2d[1]] can't be pruned, because some nodes should't be pruned, error messages for this nodes: Ignored adding Weight Pruner in: Model/Sequential[model]/Detect[24]/ModuleList[m]/NNCFConv2d[1]
INFO:nncf:Group of nodes [Model/Sequential[model]/Detect[24]/ModuleList[m]/NNCFConv2d[2]] can't be pruned, because some nodes should't be pruned, error messages for this nodes: Ignored adding Weight Pruner in: Model/Sequential[model]/Detect[24]/ModuleList[m]/NNCFConv2d[2]
INFO:nncf:Group of nodes [Model/Sequential[model]/Focus[0]/Conv[conv]/NNCFConv2d[conv]] can't be pruned, because some nodes should't be pruned, error messages for this nodes: Ignored adding Weight Pruner in: Model/Sequential[model]/Focus[0]/Conv[conv]/NNCFConv2d[conv] because this scope is one of the first convolutions
INFO:nncf:Group of nodes [Model/Sequential[model]/Conv[1]/NNCFConv2d[conv]] will be pruned together.
INFO:nncf:Group of nodes [Model/Sequential[model]/C3[2]/Conv[cv1]/NNCFConv2d[conv]] will be pruned together.
INFO:nncf:Group of nodes [Model/Sequential[model]/C3[2]/Sequential[m]/Bottleneck[0]/Conv[cv1]/NNCFConv2d[conv]] will be pruned together.
INFO:nncf:Group of nodes [Model/Sequential[model]/C3[2]/Sequential[m]/Bottleneck[0]/Conv[cv2]/NNCFConv2d[conv]] will be pruned together.
INFO:nncf:Group of nodes [Model/Sequential[model]/C3[2]/Conv[cv2]/NNCFConv2d[conv]] will be pruned together.
INFO:nncf:Group of nodes [Model/Sequential[model]/C3[2]/Conv[cv3]/NNCFConv2d[conv]] will be pruned together.
INFO:nncf:Group of nodes [Model/Sequential[model]/Conv[3]/NNCFConv2d[conv]] will be pruned together.
INFO:nncf:Group of nodes [Model/Sequential[model]/C3[4]/Conv[cv1]/NNCFConv2d[conv]] will be pruned together.
INFO:nncf:Group of nodes [Model/Sequential[model]/C3[4]/Sequential[m]/Bottleneck[0]/Conv[cv1]/NNCFConv2d[conv]] will be pruned together.
INFO:nncf:Group of nodes [Model/Sequential[model]/C3[4]/Sequential[m]/Bottleneck[0]/Conv[cv2]/NNCFConv2d[conv]] will be pruned together.
INFO:nncf:Group of nodes [Model/Sequential[model]/C3[4]/Sequential[m]/Bottleneck[1]/Conv[cv1]/NNCFConv2d[conv]] will be pruned together.
INFO:nncf:Group of nodes [Model/Sequential[model]/C3[4]/Sequential[m]/Bottleneck[1]/Conv[cv2]/NNCFConv2d[conv]] will be pruned together.
INFO:nncf:Group of nodes [Model/Sequential[model]/C3[4]/Sequential[m]/Bottleneck[2]/Conv[cv1]/NNCFConv2d[conv]] will be pruned together.
INFO:nncf:Group of nodes [Model/Sequential[model]/C3[4]/Sequential[m]/Bottleneck[2]/Conv[cv2]/NNCFConv2d[conv]] will be pruned together.
INFO:nncf:Group of nodes [Model/Sequential[model]/C3[4]/Conv[cv2]/NNCFConv2d[conv]] will be pruned together.
INFO:nncf:Group of nodes [Model/Sequential[model]/C3[4]/Conv[cv3]/NNCFConv2d[conv]] will be pruned together.
INFO:nncf:Group of nodes [Model/Sequential[model]/Conv[5]/NNCFConv2d[conv]] will be pruned together.
INFO:nncf:Group of nodes [Model/Sequential[model]/C3[6]/Conv[cv1]/NNCFConv2d[conv]] will be pruned together.
INFO:nncf:Group of nodes [Model/Sequential[model]/C3[6]/Sequential[m]/Bottleneck[0]/Conv[cv1]/NNCFConv2d[conv]] will be pruned together.
INFO:nncf:Group of nodes [Model/Sequential[model]/C3[6]/Sequential[m]/Bottleneck[0]/Conv[cv2]/NNCFConv2d[conv]] will be pruned together.
INFO:nncf:Group of nodes [Model/Sequential[model]/C3[6]/Sequential[m]/Bottleneck[1]/Conv[cv1]/NNCFConv2d[conv]] will be pruned together.
INFO:nncf:Group of nodes [Model/Sequential[model]/C3[6]/Sequential[m]/Bottleneck[1]/Conv[cv2]/NNCFConv2d[conv]] will be pruned together.
INFO:nncf:Group of nodes [Model/Sequential[model]/C3[6]/Sequential[m]/Bottleneck[2]/Conv[cv1]/NNCFConv2d[conv]] will be pruned together.
INFO:nncf:Group of nodes [Model/Sequential[model]/C3[6]/Sequential[m]/Bottleneck[2]/Conv[cv2]/NNCFConv2d[conv]] will be pruned together.
INFO:nncf:Group of nodes [Model/Sequential[model]/C3[6]/Conv[cv2]/NNCFConv2d[conv]] will be pruned together.
INFO:nncf:Group of nodes [Model/Sequential[model]/C3[6]/Conv[cv3]/NNCFConv2d[conv]] will be pruned together.
INFO:nncf:Group of nodes [Model/Sequential[model]/Conv[7]/NNCFConv2d[conv]] will be pruned together.
INFO:nncf:Group of nodes [Model/Sequential[model]/SPP[8]/Conv[cv1]/NNCFConv2d[conv]] will be pruned together.
INFO:nncf:Group of nodes [Model/Sequential[model]/SPP[8]/Conv[cv2]/NNCFConv2d[conv]] will be pruned together.
INFO:nncf:Group of nodes [Model/Sequential[model]/C3[9]/Conv[cv1]/NNCFConv2d[conv]] will be pruned together.
INFO:nncf:Group of nodes [Model/Sequential[model]/C3[9]/Sequential[m]/Bottleneck[0]/Conv[cv1]/NNCFConv2d[conv]] will be pruned together.
INFO:nncf:Group of nodes [Model/Sequential[model]/C3[9]/Sequential[m]/Bottleneck[0]/Conv[cv2]/NNCFConv2d[conv]] will be pruned together.
INFO:nncf:Group of nodes [Model/Sequential[model]/C3[9]/Conv[cv2]/NNCFConv2d[conv]] will be pruned together.
INFO:nncf:Group of nodes [Model/Sequential[model]/C3[9]/Conv[cv3]/NNCFConv2d[conv]] will be pruned together.
INFO:nncf:Group of nodes [Model/Sequential[model]/Conv[10]/NNCFConv2d[conv]] will be pruned together.
INFO:nncf:Group of nodes [Model/Sequential[model]/C3[13]/Conv[cv1]/NNCFConv2d[conv]] will be pruned together.
INFO:nncf:Group of nodes [Model/Sequential[model]/C3[13]/Sequential[m]/Bottleneck[0]/Conv[cv1]/NNCFConv2d[conv]] will be pruned together.
INFO:nncf:Group of nodes [Model/Sequential[model]/C3[13]/Sequential[m]/Bottleneck[0]/Conv[cv2]/NNCFConv2d[conv]] will be pruned together.
INFO:nncf:Group of nodes [Model/Sequential[model]/C3[13]/Conv[cv2]/NNCFConv2d[conv]] will be pruned together.
INFO:nncf:Group of nodes [Model/Sequential[model]/C3[13]/Conv[cv3]/NNCFConv2d[conv]] will be pruned together.
INFO:nncf:Group of nodes [Model/Sequential[model]/Conv[14]/NNCFConv2d[conv]] will be pruned together.
INFO:nncf:Group of nodes [Model/Sequential[model]/C3[17]/Conv[cv1]/NNCFConv2d[conv]] will be pruned together.
INFO:nncf:Group of nodes [Model/Sequential[model]/C3[17]/Sequential[m]/Bottleneck[0]/Conv[cv1]/NNCFConv2d[conv]] will be pruned together.
INFO:nncf:Group of nodes [Model/Sequential[model]/C3[17]/Sequential[m]/Bottleneck[0]/Conv[cv2]/NNCFConv2d[conv]] will be pruned together.
INFO:nncf:Group of nodes [Model/Sequential[model]/C3[17]/Conv[cv2]/NNCFConv2d[conv]] will be pruned together.
INFO:nncf:Group of nodes [Model/Sequential[model]/C3[17]/Conv[cv3]/NNCFConv2d[conv]] will be pruned together.
INFO:nncf:Group of nodes [Model/Sequential[model]/Conv[18]/NNCFConv2d[conv]] will be pruned together.
INFO:nncf:Group of nodes [Model/Sequential[model]/C3[20]/Conv[cv1]/NNCFConv2d[conv]] will be pruned together.
INFO:nncf:Group of nodes [Model/Sequential[model]/C3[20]/Sequential[m]/Bottleneck[0]/Conv[cv1]/NNCFConv2d[conv]] will be pruned together.
INFO:nncf:Group of nodes [Model/Sequential[model]/C3[20]/Sequential[m]/Bottleneck[0]/Conv[cv2]/NNCFConv2d[conv]] will be pruned together.
INFO:nncf:Group of nodes [Model/Sequential[model]/C3[20]/Conv[cv2]/NNCFConv2d[conv]] will be pruned together.
INFO:nncf:Group of nodes [Model/Sequential[model]/C3[20]/Conv[cv3]/NNCFConv2d[conv]] will be pruned together.
INFO:nncf:Group of nodes [Model/Sequential[model]/Conv[21]/NNCFConv2d[conv]] will be pruned together.
INFO:nncf:Group of nodes [Model/Sequential[model]/C3[23]/Conv[cv1]/NNCFConv2d[conv]] will be pruned together.
INFO:nncf:Group of nodes [Model/Sequential[model]/C3[23]/Sequential[m]/Bottleneck[0]/Conv[cv1]/NNCFConv2d[conv]] will be pruned together.
INFO:nncf:Group of nodes [Model/Sequential[model]/C3[23]/Sequential[m]/Bottleneck[0]/Conv[cv2]/NNCFConv2d[conv]] will be pruned together.
INFO:nncf:Group of nodes [Model/Sequential[model]/C3[23]/Conv[cv2]/NNCFConv2d[conv]] will be pruned together.
INFO:nncf:Group of nodes [Model/Sequential[model]/C3[23]/Conv[cv3]/NNCFConv2d[conv]] will be pruned together.
INFO:nncf:Adding Weight Pruner in scope: Model/Sequential[model]/Conv[1]/NNCFConv2d[conv]
INFO:nncf:Adding Weight Pruner in scope: Model/Sequential[model]/C3[2]/Conv[cv1]/NNCFConv2d[conv]
INFO:nncf:Adding Weight Pruner in scope: Model/Sequential[model]/C3[2]/Sequential[m]/Bottleneck[0]/Conv[cv1]/NNCFConv2d[conv]
INFO:nncf:Adding Weight Pruner in scope: Model/Sequential[model]/C3[2]/Sequential[m]/Bottleneck[0]/Conv[cv2]/NNCFConv2d[conv]
INFO:nncf:Adding Weight Pruner in scope: Model/Sequential[model]/C3[2]/Conv[cv2]/NNCFConv2d[conv]
INFO:nncf:Adding Weight Pruner in scope: Model/Sequential[model]/C3[2]/Conv[cv3]/NNCFConv2d[conv]
INFO:nncf:Adding Weight Pruner in scope: Model/Sequential[model]/Conv[3]/NNCFConv2d[conv]
INFO:nncf:Adding Weight Pruner in scope: Model/Sequential[model]/C3[4]/Conv[cv1]/NNCFConv2d[conv]
INFO:nncf:Adding Weight Pruner in scope: Model/Sequential[model]/C3[4]/Sequential[m]/Bottleneck[0]/Conv[cv1]/NNCFConv2d[conv]
INFO:nncf:Adding Weight Pruner in scope: Model/Sequential[model]/C3[4]/Sequential[m]/Bottleneck[0]/Conv[cv2]/NNCFConv2d[conv]
INFO:nncf:Adding Weight Pruner in scope: Model/Sequential[model]/C3[4]/Sequential[m]/Bottleneck[1]/Conv[cv1]/NNCFConv2d[conv]
INFO:nncf:Adding Weight Pruner in scope: Model/Sequential[model]/C3[4]/Sequential[m]/Bottleneck[1]/Conv[cv2]/NNCFConv2d[conv]
INFO:nncf:Adding Weight Pruner in scope: Model/Sequential[model]/C3[4]/Sequential[m]/Bottleneck[2]/Conv[cv1]/NNCFConv2d[conv]
INFO:nncf:Adding Weight Pruner in scope: Model/Sequential[model]/C3[4]/Sequential[m]/Bottleneck[2]/Conv[cv2]/NNCFConv2d[conv]
INFO:nncf:Adding Weight Pruner in scope: Model/Sequential[model]/C3[4]/Conv[cv2]/NNCFConv2d[conv]
INFO:nncf:Adding Weight Pruner in scope: Model/Sequential[model]/C3[4]/Conv[cv3]/NNCFConv2d[conv]
INFO:nncf:Adding Weight Pruner in scope: Model/Sequential[model]/Conv[5]/NNCFConv2d[conv]
INFO:nncf:Adding Weight Pruner in scope: Model/Sequential[model]/C3[6]/Conv[cv1]/NNCFConv2d[conv]
INFO:nncf:Adding Weight Pruner in scope: Model/Sequential[model]/C3[6]/Sequential[m]/Bottleneck[0]/Conv[cv1]/NNCFConv2d[conv]
INFO:nncf:Adding Weight Pruner in scope: Model/Sequential[model]/C3[6]/Sequential[m]/Bottleneck[0]/Conv[cv2]/NNCFConv2d[conv]
INFO:nncf:Adding Weight Pruner in scope: Model/Sequential[model]/C3[6]/Sequential[m]/Bottleneck[1]/Conv[cv1]/NNCFConv2d[conv]
INFO:nncf:Adding Weight Pruner in scope: Model/Sequential[model]/C3[6]/Sequential[m]/Bottleneck[1]/Conv[cv2]/NNCFConv2d[conv]
INFO:nncf:Adding Weight Pruner in scope: Model/Sequential[model]/C3[6]/Sequential[m]/Bottleneck[2]/Conv[cv1]/NNCFConv2d[conv]
INFO:nncf:Adding Weight Pruner in scope: Model/Sequential[model]/C3[6]/Sequential[m]/Bottleneck[2]/Conv[cv2]/NNCFConv2d[conv]
INFO:nncf:Adding Weight Pruner in scope: Model/Sequential[model]/C3[6]/Conv[cv2]/NNCFConv2d[conv]
INFO:nncf:Adding Weight Pruner in scope: Model/Sequential[model]/C3[6]/Conv[cv3]/NNCFConv2d[conv]
INFO:nncf:Adding Weight Pruner in scope: Model/Sequential[model]/Conv[7]/NNCFConv2d[conv]
INFO:nncf:Adding Weight Pruner in scope: Model/Sequential[model]/SPP[8]/Conv[cv1]/NNCFConv2d[conv]
INFO:nncf:Adding Weight Pruner in scope: Model/Sequential[model]/SPP[8]/Conv[cv2]/NNCFConv2d[conv]
INFO:nncf:Adding Weight Pruner in scope: Model/Sequential[model]/C3[9]/Conv[cv1]/NNCFConv2d[conv]
INFO:nncf:Adding Weight Pruner in scope: Model/Sequential[model]/C3[9]/Sequential[m]/Bottleneck[0]/Conv[cv1]/NNCFConv2d[conv]
INFO:nncf:Adding Weight Pruner in scope: Model/Sequential[model]/C3[9]/Sequential[m]/Bottleneck[0]/Conv[cv2]/NNCFConv2d[conv]
INFO:nncf:Adding Weight Pruner in scope: Model/Sequential[model]/C3[9]/Conv[cv2]/NNCFConv2d[conv]
INFO:nncf:Adding Weight Pruner in scope: Model/Sequential[model]/C3[9]/Conv[cv3]/NNCFConv2d[conv]
INFO:nncf:Adding Weight Pruner in scope: Model/Sequential[model]/Conv[10]/NNCFConv2d[conv]
INFO:nncf:Adding Weight Pruner in scope: Model/Sequential[model]/C3[13]/Conv[cv1]/NNCFConv2d[conv]
INFO:nncf:Adding Weight Pruner in scope: Model/Sequential[model]/C3[13]/Sequential[m]/Bottleneck[0]/Conv[cv1]/NNCFConv2d[conv]
INFO:nncf:Adding Weight Pruner in scope: Model/Sequential[model]/C3[13]/Sequential[m]/Bottleneck[0]/Conv[cv2]/NNCFConv2d[conv]
INFO:nncf:Adding Weight Pruner in scope: Model/Sequential[model]/C3[13]/Conv[cv2]/NNCFConv2d[conv]
INFO:nncf:Adding Weight Pruner in scope: Model/Sequential[model]/C3[13]/Conv[cv3]/NNCFConv2d[conv]
INFO:nncf:Adding Weight Pruner in scope: Model/Sequential[model]/Conv[14]/NNCFConv2d[conv]
INFO:nncf:Adding Weight Pruner in scope: Model/Sequential[model]/C3[17]/Conv[cv1]/NNCFConv2d[conv]
INFO:nncf:Adding Weight Pruner in scope: Model/Sequential[model]/C3[17]/Sequential[m]/Bottleneck[0]/Conv[cv1]/NNCFConv2d[conv]
INFO:nncf:Adding Weight Pruner in scope: Model/Sequential[model]/C3[17]/Sequential[m]/Bottleneck[0]/Conv[cv2]/NNCFConv2d[conv]
INFO:nncf:Adding Weight Pruner in scope: Model/Sequential[model]/C3[17]/Conv[cv2]/NNCFConv2d[conv]
INFO:nncf:Adding Weight Pruner in scope: Model/Sequential[model]/C3[17]/Conv[cv3]/NNCFConv2d[conv]
INFO:nncf:Adding Weight Pruner in scope: Model/Sequential[model]/Conv[18]/NNCFConv2d[conv]
INFO:nncf:Adding Weight Pruner in scope: Model/Sequential[model]/C3[20]/Conv[cv1]/NNCFConv2d[conv]
INFO:nncf:Adding Weight Pruner in scope: Model/Sequential[model]/C3[20]/Sequential[m]/Bottleneck[0]/Conv[cv1]/NNCFConv2d[conv]
INFO:nncf:Adding Weight Pruner in scope: Model/Sequential[model]/C3[20]/Sequential[m]/Bottleneck[0]/Conv[cv2]/NNCFConv2d[conv]
INFO:nncf:Adding Weight Pruner in scope: Model/Sequential[model]/C3[20]/Conv[cv2]/NNCFConv2d[conv]
INFO:nncf:Adding Weight Pruner in scope: Model/Sequential[model]/C3[20]/Conv[cv3]/NNCFConv2d[conv]
INFO:nncf:Adding Weight Pruner in scope: Model/Sequential[model]/Conv[21]/NNCFConv2d[conv]
INFO:nncf:Adding Weight Pruner in scope: Model/Sequential[model]/C3[23]/Conv[cv1]/NNCFConv2d[conv]
INFO:nncf:Adding Weight Pruner in scope: Model/Sequential[model]/C3[23]/Sequential[m]/Bottleneck[0]/Conv[cv1]/NNCFConv2d[conv]
INFO:nncf:Adding Weight Pruner in scope: Model/Sequential[model]/C3[23]/Sequential[m]/Bottleneck[0]/Conv[cv2]/NNCFConv2d[conv]
INFO:nncf:Adding Weight Pruner in scope: Model/Sequential[model]/C3[23]/Conv[cv2]/NNCFConv2d[conv]
INFO:nncf:Adding Weight Pruner in scope: Model/Sequential[model]/C3[23]/Conv[cv3]/NNCFConv2d[conv]
INFO:nncf:Computing filter importance scores and binary masks...
WARNING:nncf:Graphviz is not installed - only the .dot model visualization format will be used. Install pygraphviz into your Python environment and graphviz system-wide to enable PNG rendering.
INFO:nncf:Computing filter importance scores and binary masks...

     Epoch   gpu_mem       box       obj       cls     total    labels  img_size
       0/0     5.57G    0.1033    0.0569   0.04191    0.2021       181       640:   3%|█▏                                         | 100/3458 [00:32<18:02,  3.10it/s]
               Class      Images      Labels           P           R      mAP@.5  mAP@.5:.95: 100%|████████████████████████████████| 121/121 [00:58<00:00,  2.08it/s]
                 all        5784       15161    0.000353       0.033    8.58e-05    1.52e-05
                   0        5784       11004     0.00176       0.165    0.000429     7.6e-05
                   1        5784        1932           0           0           0           0
                   2        5784         687           0           0           0           0
                   3        5784         218           0           0           0           0
                   4        5784        1320           0           0           0           0
INFO:nncf:Start pruning model
/home/lee/anaconda3/envs/py38/lib/python3.8/site-packages/nncf/pruning/export_helpers.py:210: UserWarning: To copy construct from a tensor, it is recommended to use sourceTensor.clone().detach() or sourceTensor.clone().detach().requires_grad_(True), rather than torch.tensor(sourceTensor).
  bool_mask = torch.tensor(mask, dtype=torch.bool)
INFO:nncf:Pruned Convolution 136 Model/Sequential[model]/C3[23]/Conv[cv3]/NNCFConv2d[conv]/conv2d by pruning mask. Old output filters number: 512, new filters number: 256.
/home/lee/anaconda3/envs/py38/lib/python3.8/site-packages/nncf/pruning/export_helpers.py:314: UserWarning: To copy construct from a tensor, it is recommended to use sourceTensor.clone().detach() or sourceTensor.clone().detach().requires_grad_(True), rather than torch.tensor(sourceTensor).
  bool_mask = torch.tensor(input_mask, dtype=torch.bool)
INFO:nncf:Pruned BatchNorm 137 Model/Sequential[model]/C3[23]/Conv[cv3]/BatchNorm2d[bn]/batch_norm by input mask. Old num features: 512, new num features: 256.
INFO:nncf:Pruned Convolution 131 Model/Sequential[model]/C3[23]/Sequential[m]/Bottleneck[0]/Conv[cv2]/NNCFConv2d[conv]/conv2d by pruning mask. Old output filters number: 256, new filters number: 128.
INFO:nncf:Pruned BatchNorm 132 Model/Sequential[model]/C3[23]/Sequential[m]/Bottleneck[0]/Conv[cv2]/BatchNorm2d[bn]/batch_norm by input mask. Old num features: 256, new num features: 128.
INFO:nncf:Pruned Convolution 129 Model/Sequential[model]/C3[23]/Sequential[m]/Bottleneck[0]/Conv[cv1]/NNCFConv2d[conv]/conv2d by pruning mask. Old output filters number: 256, new filters number: 128.
INFO:nncf:Pruned BatchNorm 130 Model/Sequential[model]/C3[23]/Sequential[m]/Bottleneck[0]/Conv[cv1]/BatchNorm2d[bn]/batch_norm by input mask. Old num features: 256, new num features: 128.
INFO:nncf:Pruned Convolution 133 Model/Sequential[model]/C3[23]/Conv[cv2]/NNCFConv2d[conv]/conv2d by pruning mask. Old output filters number: 256, new filters number: 128.
INFO:nncf:Pruned BatchNorm 134 Model/Sequential[model]/C3[23]/Conv[cv2]/BatchNorm2d[bn]/batch_norm by input mask. Old num features: 256, new num features: 128.
INFO:nncf:Pruned Convolution 127 Model/Sequential[model]/C3[23]/Conv[cv1]/NNCFConv2d[conv]/conv2d by pruning mask. Old output filters number: 256, new filters number: 128.
INFO:nncf:Pruned BatchNorm 128 Model/Sequential[model]/C3[23]/Conv[cv1]/BatchNorm2d[bn]/batch_norm by input mask. Old num features: 256, new num features: 128.
INFO:nncf:Pruned Convolution 124 Model/Sequential[model]/Conv[21]/NNCFConv2d[conv]/conv2d by pruning mask. Old output filters number: 256, new filters number: 128.
INFO:nncf:Pruned BatchNorm 125 Model/Sequential[model]/Conv[21]/BatchNorm2d[bn]/batch_norm by input mask. Old num features: 256, new num features: 128.
INFO:nncf:Pruned Convolution 122 Model/Sequential[model]/C3[20]/Conv[cv3]/NNCFConv2d[conv]/conv2d by pruning mask. Old output filters number: 256, new filters number: 128.
INFO:nncf:Pruned BatchNorm 123 Model/Sequential[model]/C3[20]/Conv[cv3]/BatchNorm2d[bn]/batch_norm by input mask. Old num features: 256, new num features: 128.
INFO:nncf:Pruned Convolution 117 Model/Sequential[model]/C3[20]/Sequential[m]/Bottleneck[0]/Conv[cv2]/NNCFConv2d[conv]/conv2d by pruning mask. Old output filters number: 128, new filters number: 64.
INFO:nncf:Pruned BatchNorm 118 Model/Sequential[model]/C3[20]/Sequential[m]/Bottleneck[0]/Conv[cv2]/BatchNorm2d[bn]/batch_norm by input mask. Old num features: 128, new num features: 64.
INFO:nncf:Pruned Convolution 115 Model/Sequential[model]/C3[20]/Sequential[m]/Bottleneck[0]/Conv[cv1]/NNCFConv2d[conv]/conv2d by pruning mask. Old output filters number: 128, new filters number: 64.
INFO:nncf:Pruned BatchNorm 116 Model/Sequential[model]/C3[20]/Sequential[m]/Bottleneck[0]/Conv[cv1]/BatchNorm2d[bn]/batch_norm by input mask. Old num features: 128, new num features: 64.
INFO:nncf:Pruned Convolution 119 Model/Sequential[model]/C3[20]/Conv[cv2]/NNCFConv2d[conv]/conv2d by pruning mask. Old output filters number: 128, new filters number: 64.
INFO:nncf:Pruned BatchNorm 120 Model/Sequential[model]/C3[20]/Conv[cv2]/BatchNorm2d[bn]/batch_norm by input mask. Old num features: 128, new num features: 64.
INFO:nncf:Pruned Convolution 113 Model/Sequential[model]/C3[20]/Conv[cv1]/NNCFConv2d[conv]/conv2d by pruning mask. Old output filters number: 128, new filters number: 64.
INFO:nncf:Pruned BatchNorm 114 Model/Sequential[model]/C3[20]/Conv[cv1]/BatchNorm2d[bn]/batch_norm by input mask. Old num features: 128, new num features: 64.
INFO:nncf:Pruned Convolution 110 Model/Sequential[model]/Conv[18]/NNCFConv2d[conv]/conv2d by pruning mask. Old output filters number: 128, new filters number: 64.
INFO:nncf:Pruned BatchNorm 111 Model/Sequential[model]/Conv[18]/BatchNorm2d[bn]/batch_norm by input mask. Old num features: 128, new num features: 64.
INFO:nncf:Pruned Convolution 108 Model/Sequential[model]/C3[17]/Conv[cv3]/NNCFConv2d[conv]/conv2d by pruning mask. Old output filters number: 128, new filters number: 64.
INFO:nncf:Pruned BatchNorm 109 Model/Sequential[model]/C3[17]/Conv[cv3]/BatchNorm2d[bn]/batch_norm by input mask. Old num features: 128, new num features: 64.
INFO:nncf:Pruned Convolution 103 Model/Sequential[model]/C3[17]/Sequential[m]/Bottleneck[0]/Conv[cv2]/NNCFConv2d[conv]/conv2d by pruning mask. Old output filters number: 64, new filters number: 32.
INFO:nncf:Pruned BatchNorm 104 Model/Sequential[model]/C3[17]/Sequential[m]/Bottleneck[0]/Conv[cv2]/BatchNorm2d[bn]/batch_norm by input mask. Old num features: 64, new num features: 32.
INFO:nncf:Pruned Convolution 101 Model/Sequential[model]/C3[17]/Sequential[m]/Bottleneck[0]/Conv[cv1]/NNCFConv2d[conv]/conv2d by pruning mask. Old output filters number: 64, new filters number: 32.
INFO:nncf:Pruned BatchNorm 102 Model/Sequential[model]/C3[17]/Sequential[m]/Bottleneck[0]/Conv[cv1]/BatchNorm2d[bn]/batch_norm by input mask. Old num features: 64, new num features: 32.
INFO:nncf:Pruned Convolution 105 Model/Sequential[model]/C3[17]/Conv[cv2]/NNCFConv2d[conv]/conv2d by pruning mask. Old output filters number: 64, new filters number: 32.
INFO:nncf:Pruned BatchNorm 106 Model/Sequential[model]/C3[17]/Conv[cv2]/BatchNorm2d[bn]/batch_norm by input mask. Old num features: 64, new num features: 32.
INFO:nncf:Pruned Convolution 99 Model/Sequential[model]/C3[17]/Conv[cv1]/NNCFConv2d[conv]/conv2d by pruning mask. Old output filters number: 64, new filters number: 32.
INFO:nncf:Pruned BatchNorm 100 Model/Sequential[model]/C3[17]/Conv[cv1]/BatchNorm2d[bn]/batch_norm by input mask. Old num features: 64, new num features: 32.
INFO:nncf:Pruned Convolution 95 Model/Sequential[model]/Conv[14]/NNCFConv2d[conv]/conv2d by pruning mask. Old output filters number: 128, new filters number: 64.
INFO:nncf:Pruned BatchNorm 96 Model/Sequential[model]/Conv[14]/BatchNorm2d[bn]/batch_norm by input mask. Old num features: 128, new num features: 64.
INFO:nncf:Pruned Convolution 93 Model/Sequential[model]/C3[13]/Conv[cv3]/NNCFConv2d[conv]/conv2d by pruning mask. Old output filters number: 256, new filters number: 128.
INFO:nncf:Pruned BatchNorm 94 Model/Sequential[model]/C3[13]/Conv[cv3]/BatchNorm2d[bn]/batch_norm by input mask. Old num features: 256, new num features: 128.
INFO:nncf:Pruned Convolution 88 Model/Sequential[model]/C3[13]/Sequential[m]/Bottleneck[0]/Conv[cv2]/NNCFConv2d[conv]/conv2d by pruning mask. Old output filters number: 128, new filters number: 64.
INFO:nncf:Pruned BatchNorm 89 Model/Sequential[model]/C3[13]/Sequential[m]/Bottleneck[0]/Conv[cv2]/BatchNorm2d[bn]/batch_norm by input mask. Old num features: 128, new num features: 64.
INFO:nncf:Pruned Convolution 86 Model/Sequential[model]/C3[13]/Sequential[m]/Bottleneck[0]/Conv[cv1]/NNCFConv2d[conv]/conv2d by pruning mask. Old output filters number: 128, new filters number: 64.
INFO:nncf:Pruned BatchNorm 87 Model/Sequential[model]/C3[13]/Sequential[m]/Bottleneck[0]/Conv[cv1]/BatchNorm2d[bn]/batch_norm by input mask. Old num features: 128, new num features: 64.
INFO:nncf:Pruned Convolution 90 Model/Sequential[model]/C3[13]/Conv[cv2]/NNCFConv2d[conv]/conv2d by pruning mask. Old output filters number: 128, new filters number: 64.
INFO:nncf:Pruned BatchNorm 91 Model/Sequential[model]/C3[13]/Conv[cv2]/BatchNorm2d[bn]/batch_norm by input mask. Old num features: 128, new num features: 64.
INFO:nncf:Pruned Convolution 84 Model/Sequential[model]/C3[13]/Conv[cv1]/NNCFConv2d[conv]/conv2d by pruning mask. Old output filters number: 128, new filters number: 64.
INFO:nncf:Pruned BatchNorm 85 Model/Sequential[model]/C3[13]/Conv[cv1]/BatchNorm2d[bn]/batch_norm by input mask. Old num features: 128, new num features: 64.
INFO:nncf:Pruned Convolution 80 Model/Sequential[model]/Conv[10]/NNCFConv2d[conv]/conv2d by pruning mask. Old output filters number: 256, new filters number: 128.
INFO:nncf:Pruned BatchNorm 81 Model/Sequential[model]/Conv[10]/BatchNorm2d[bn]/batch_norm by input mask. Old num features: 256, new num features: 128.
INFO:nncf:Pruned Convolution 78 Model/Sequential[model]/C3[9]/Conv[cv3]/NNCFConv2d[conv]/conv2d by pruning mask. Old output filters number: 512, new filters number: 256.
INFO:nncf:Pruned BatchNorm 79 Model/Sequential[model]/C3[9]/Conv[cv3]/BatchNorm2d[bn]/batch_norm by input mask. Old num features: 512, new num features: 256.
INFO:nncf:Pruned Convolution 75 Model/Sequential[model]/C3[9]/Conv[cv2]/NNCFConv2d[conv]/conv2d by pruning mask. Old output filters number: 256, new filters number: 128.
INFO:nncf:Pruned BatchNorm 76 Model/Sequential[model]/C3[9]/Conv[cv2]/BatchNorm2d[bn]/batch_norm by input mask. Old num features: 256, new num features: 128.
INFO:nncf:Pruned Convolution 73 Model/Sequential[model]/C3[9]/Sequential[m]/Bottleneck[0]/Conv[cv2]/NNCFConv2d[conv]/conv2d by pruning mask. Old output filters number: 256, new filters number: 128.
INFO:nncf:Pruned BatchNorm 74 Model/Sequential[model]/C3[9]/Sequential[m]/Bottleneck[0]/Conv[cv2]/BatchNorm2d[bn]/batch_norm by input mask. Old num features: 256, new num features: 128.
INFO:nncf:Pruned Convolution 71 Model/Sequential[model]/C3[9]/Sequential[m]/Bottleneck[0]/Conv[cv1]/NNCFConv2d[conv]/conv2d by pruning mask. Old output filters number: 256, new filters number: 128.
INFO:nncf:Pruned BatchNorm 72 Model/Sequential[model]/C3[9]/Sequential[m]/Bottleneck[0]/Conv[cv1]/BatchNorm2d[bn]/batch_norm by input mask. Old num features: 256, new num features: 128.
INFO:nncf:Pruned Convolution 69 Model/Sequential[model]/C3[9]/Conv[cv1]/NNCFConv2d[conv]/conv2d by pruning mask. Old output filters number: 256, new filters number: 128.
INFO:nncf:Pruned BatchNorm 70 Model/Sequential[model]/C3[9]/Conv[cv1]/BatchNorm2d[bn]/batch_norm by input mask. Old num features: 256, new num features: 128.
INFO:nncf:Pruned Convolution 67 Model/Sequential[model]/SPP[8]/Conv[cv2]/NNCFConv2d[conv]/conv2d by pruning mask. Old output filters number: 512, new filters number: 256.
INFO:nncf:Pruned BatchNorm 68 Model/Sequential[model]/SPP[8]/Conv[cv2]/BatchNorm2d[bn]/batch_norm by input mask. Old num features: 512, new num features: 256.
INFO:nncf:Pruned Convolution 61 Model/Sequential[model]/SPP[8]/Conv[cv1]/NNCFConv2d[conv]/conv2d by pruning mask. Old output filters number: 256, new filters number: 128.
INFO:nncf:Pruned BatchNorm 62 Model/Sequential[model]/SPP[8]/Conv[cv1]/BatchNorm2d[bn]/batch_norm by input mask. Old num features: 256, new num features: 128.
INFO:nncf:Pruned Convolution 59 Model/Sequential[model]/Conv[7]/NNCFConv2d[conv]/conv2d by pruning mask. Old output filters number: 512, new filters number: 256.
INFO:nncf:Pruned BatchNorm 60 Model/Sequential[model]/Conv[7]/BatchNorm2d[bn]/batch_norm by input mask. Old num features: 512, new num features: 256.
INFO:nncf:Pruned Convolution 57 Model/Sequential[model]/C3[6]/Conv[cv3]/NNCFConv2d[conv]/conv2d by pruning mask. Old output filters number: 256, new filters number: 128.
INFO:nncf:Pruned BatchNorm 58 Model/Sequential[model]/C3[6]/Conv[cv3]/BatchNorm2d[bn]/batch_norm by input mask. Old num features: 256, new num features: 128.
INFO:nncf:Pruned Convolution 54 Model/Sequential[model]/C3[6]/Conv[cv2]/NNCFConv2d[conv]/conv2d by pruning mask. Old output filters number: 128, new filters number: 64.
INFO:nncf:Pruned BatchNorm 55 Model/Sequential[model]/C3[6]/Conv[cv2]/BatchNorm2d[bn]/batch_norm by input mask. Old num features: 128, new num features: 64.
INFO:nncf:Pruned Convolution 52 Model/Sequential[model]/C3[6]/Sequential[m]/Bottleneck[2]/Conv[cv2]/NNCFConv2d[conv]/conv2d by pruning mask. Old output filters number: 128, new filters number: 64.
INFO:nncf:Pruned BatchNorm 53 Model/Sequential[model]/C3[6]/Sequential[m]/Bottleneck[2]/Conv[cv2]/BatchNorm2d[bn]/batch_norm by input mask. Old num features: 128, new num features: 64.
INFO:nncf:Pruned Convolution 50 Model/Sequential[model]/C3[6]/Sequential[m]/Bottleneck[2]/Conv[cv1]/NNCFConv2d[conv]/conv2d by pruning mask. Old output filters number: 128, new filters number: 64.
INFO:nncf:Pruned BatchNorm 51 Model/Sequential[model]/C3[6]/Sequential[m]/Bottleneck[2]/Conv[cv1]/BatchNorm2d[bn]/batch_norm by input mask. Old num features: 128, new num features: 64.
INFO:nncf:Pruned Convolution 48 Model/Sequential[model]/C3[6]/Sequential[m]/Bottleneck[1]/Conv[cv2]/NNCFConv2d[conv]/conv2d by pruning mask. Old output filters number: 128, new filters number: 64.
INFO:nncf:Pruned BatchNorm 49 Model/Sequential[model]/C3[6]/Sequential[m]/Bottleneck[1]/Conv[cv2]/BatchNorm2d[bn]/batch_norm by input mask. Old num features: 128, new num features: 64.
INFO:nncf:Pruned Convolution 46 Model/Sequential[model]/C3[6]/Sequential[m]/Bottleneck[1]/Conv[cv1]/NNCFConv2d[conv]/conv2d by pruning mask. Old output filters number: 128, new filters number: 64.
INFO:nncf:Pruned BatchNorm 47 Model/Sequential[model]/C3[6]/Sequential[m]/Bottleneck[1]/Conv[cv1]/BatchNorm2d[bn]/batch_norm by input mask. Old num features: 128, new num features: 64.
INFO:nncf:Pruned Convolution 44 Model/Sequential[model]/C3[6]/Sequential[m]/Bottleneck[0]/Conv[cv2]/NNCFConv2d[conv]/conv2d by pruning mask. Old output filters number: 128, new filters number: 64.
INFO:nncf:Pruned BatchNorm 45 Model/Sequential[model]/C3[6]/Sequential[m]/Bottleneck[0]/Conv[cv2]/BatchNorm2d[bn]/batch_norm by input mask. Old num features: 128, new num features: 64.
INFO:nncf:Pruned Convolution 42 Model/Sequential[model]/C3[6]/Sequential[m]/Bottleneck[0]/Conv[cv1]/NNCFConv2d[conv]/conv2d by pruning mask. Old output filters number: 128, new filters number: 64.
INFO:nncf:Pruned BatchNorm 43 Model/Sequential[model]/C3[6]/Sequential[m]/Bottleneck[0]/Conv[cv1]/BatchNorm2d[bn]/batch_norm by input mask. Old num features: 128, new num features: 64.
INFO:nncf:Pruned Convolution 40 Model/Sequential[model]/C3[6]/Conv[cv1]/NNCFConv2d[conv]/conv2d by pruning mask. Old output filters number: 128, new filters number: 64.
INFO:nncf:Pruned BatchNorm 41 Model/Sequential[model]/C3[6]/Conv[cv1]/BatchNorm2d[bn]/batch_norm by input mask. Old num features: 128, new num features: 64.
INFO:nncf:Pruned Convolution 38 Model/Sequential[model]/Conv[5]/NNCFConv2d[conv]/conv2d by pruning mask. Old output filters number: 256, new filters number: 128.
INFO:nncf:Pruned BatchNorm 39 Model/Sequential[model]/Conv[5]/BatchNorm2d[bn]/batch_norm by input mask. Old num features: 256, new num features: 128.
INFO:nncf:Pruned Convolution 36 Model/Sequential[model]/C3[4]/Conv[cv3]/NNCFConv2d[conv]/conv2d by pruning mask. Old output filters number: 128, new filters number: 64.
INFO:nncf:Pruned BatchNorm 37 Model/Sequential[model]/C3[4]/Conv[cv3]/BatchNorm2d[bn]/batch_norm by input mask. Old num features: 128, new num features: 64.
INFO:nncf:Pruned Convolution 33 Model/Sequential[model]/C3[4]/Conv[cv2]/NNCFConv2d[conv]/conv2d by pruning mask. Old output filters number: 64, new filters number: 32.
INFO:nncf:Pruned BatchNorm 34 Model/Sequential[model]/C3[4]/Conv[cv2]/BatchNorm2d[bn]/batch_norm by input mask. Old num features: 64, new num features: 32.
INFO:nncf:Pruned Convolution 31 Model/Sequential[model]/C3[4]/Sequential[m]/Bottleneck[2]/Conv[cv2]/NNCFConv2d[conv]/conv2d by pruning mask. Old output filters number: 64, new filters number: 32.
INFO:nncf:Pruned BatchNorm 32 Model/Sequential[model]/C3[4]/Sequential[m]/Bottleneck[2]/Conv[cv2]/BatchNorm2d[bn]/batch_norm by input mask. Old num features: 64, new num features: 32.
INFO:nncf:Pruned Convolution 29 Model/Sequential[model]/C3[4]/Sequential[m]/Bottleneck[2]/Conv[cv1]/NNCFConv2d[conv]/conv2d by pruning mask. Old output filters number: 64, new filters number: 32.
INFO:nncf:Pruned BatchNorm 30 Model/Sequential[model]/C3[4]/Sequential[m]/Bottleneck[2]/Conv[cv1]/BatchNorm2d[bn]/batch_norm by input mask. Old num features: 64, new num features: 32.
INFO:nncf:Pruned Convolution 27 Model/Sequential[model]/C3[4]/Sequential[m]/Bottleneck[1]/Conv[cv2]/NNCFConv2d[conv]/conv2d by pruning mask. Old output filters number: 64, new filters number: 32.
INFO:nncf:Pruned BatchNorm 28 Model/Sequential[model]/C3[4]/Sequential[m]/Bottleneck[1]/Conv[cv2]/BatchNorm2d[bn]/batch_norm by input mask. Old num features: 64, new num features: 32.
INFO:nncf:Pruned Convolution 25 Model/Sequential[model]/C3[4]/Sequential[m]/Bottleneck[1]/Conv[cv1]/NNCFConv2d[conv]/conv2d by pruning mask. Old output filters number: 64, new filters number: 32.
INFO:nncf:Pruned BatchNorm 26 Model/Sequential[model]/C3[4]/Sequential[m]/Bottleneck[1]/Conv[cv1]/BatchNorm2d[bn]/batch_norm by input mask. Old num features: 64, new num features: 32.
INFO:nncf:Pruned Convolution 23 Model/Sequential[model]/C3[4]/Sequential[m]/Bottleneck[0]/Conv[cv2]/NNCFConv2d[conv]/conv2d by pruning mask. Old output filters number: 64, new filters number: 32.
INFO:nncf:Pruned BatchNorm 24 Model/Sequential[model]/C3[4]/Sequential[m]/Bottleneck[0]/Conv[cv2]/BatchNorm2d[bn]/batch_norm by input mask. Old num features: 64, new num features: 32.
INFO:nncf:Pruned Convolution 21 Model/Sequential[model]/C3[4]/Sequential[m]/Bottleneck[0]/Conv[cv1]/NNCFConv2d[conv]/conv2d by pruning mask. Old output filters number: 64, new filters number: 32.
INFO:nncf:Pruned BatchNorm 22 Model/Sequential[model]/C3[4]/Sequential[m]/Bottleneck[0]/Conv[cv1]/BatchNorm2d[bn]/batch_norm by input mask. Old num features: 64, new num features: 32.
INFO:nncf:Pruned Convolution 19 Model/Sequential[model]/C3[4]/Conv[cv1]/NNCFConv2d[conv]/conv2d by pruning mask. Old output filters number: 64, new filters number: 32.
INFO:nncf:Pruned BatchNorm 20 Model/Sequential[model]/C3[4]/Conv[cv1]/BatchNorm2d[bn]/batch_norm by input mask. Old num features: 64, new num features: 32.
INFO:nncf:Pruned Convolution 17 Model/Sequential[model]/Conv[3]/NNCFConv2d[conv]/conv2d by pruning mask. Old output filters number: 128, new filters number: 64.
INFO:nncf:Pruned BatchNorm 18 Model/Sequential[model]/Conv[3]/BatchNorm2d[bn]/batch_norm by input mask. Old num features: 128, new num features: 64.
INFO:nncf:Pruned Convolution 15 Model/Sequential[model]/C3[2]/Conv[cv3]/NNCFConv2d[conv]/conv2d by pruning mask. Old output filters number: 64, new filters number: 32.
INFO:nncf:Pruned BatchNorm 16 Model/Sequential[model]/C3[2]/Conv[cv3]/BatchNorm2d[bn]/batch_norm by input mask. Old num features: 64, new num features: 32.
INFO:nncf:Pruned Convolution 12 Model/Sequential[model]/C3[2]/Conv[cv2]/NNCFConv2d[conv]/conv2d by pruning mask. Old output filters number: 32, new filters number: 16.
INFO:nncf:Pruned BatchNorm 13 Model/Sequential[model]/C3[2]/Conv[cv2]/BatchNorm2d[bn]/batch_norm by input mask. Old num features: 32, new num features: 16.
INFO:nncf:Pruned Convolution 10 Model/Sequential[model]/C3[2]/Sequential[m]/Bottleneck[0]/Conv[cv2]/NNCFConv2d[conv]/conv2d by pruning mask. Old output filters number: 32, new filters number: 16.
INFO:nncf:Pruned BatchNorm 11 Model/Sequential[model]/C3[2]/Sequential[m]/Bottleneck[0]/Conv[cv2]/BatchNorm2d[bn]/batch_norm by input mask. Old num features: 32, new num features: 16.
INFO:nncf:Pruned Convolution 8 Model/Sequential[model]/C3[2]/Sequential[m]/Bottleneck[0]/Conv[cv1]/NNCFConv2d[conv]/conv2d by pruning mask. Old output filters number: 32, new filters number: 16.
INFO:nncf:Pruned BatchNorm 9 Model/Sequential[model]/C3[2]/Sequential[m]/Bottleneck[0]/Conv[cv1]/BatchNorm2d[bn]/batch_norm by input mask. Old num features: 32, new num features: 16.
INFO:nncf:Pruned Convolution 6 Model/Sequential[model]/C3[2]/Conv[cv1]/NNCFConv2d[conv]/conv2d by pruning mask. Old output filters number: 32, new filters number: 16.
INFO:nncf:Pruned BatchNorm 7 Model/Sequential[model]/C3[2]/Conv[cv1]/BatchNorm2d[bn]/batch_norm by input mask. Old num features: 32, new num features: 16.
INFO:nncf:Pruned Convolution 4 Model/Sequential[model]/Conv[1]/NNCFConv2d[conv]/conv2d by pruning mask. Old output filters number: 64, new filters number: 32.
INFO:nncf:Pruned BatchNorm 5 Model/Sequential[model]/Conv[1]/BatchNorm2d[bn]/batch_norm by input mask. Old num features: 64, new num features: 32.
INFO:nncf:Finished mask applying step
INFO:nncf:Finished pruning model
Traceback (most recent call last):
  File "train.py", line 586, in <module>
    train(hyp, opt, device, tb_writer)
  File "train.py", line 450, in train
    compression_ctrl.export_model("./yolov5s_compressed.onnx")
  File "/home/lee/anaconda3/envs/py38/lib/python3.8/site-packages/nncf/compression_method_api.py", line 164, in export_model
    self.prepare_for_export()
  File "/home/lee/anaconda3/envs/py38/lib/python3.8/site-packages/nncf/pruning/filter_pruning/algo.py", line 611, in prepare_for_export
    flops_after = model.get_MACs_in_model()
  File "/home/lee/anaconda3/envs/py38/lib/python3.8/site-packages/nncf/nncf_network.py", line 762, in get_MACs_in_model
    flops_count_dict = self.get_flops_per_module()
  File "/home/lee/anaconda3/envs/py38/lib/python3.8/site-packages/nncf/nncf_network.py", line 752, in get_flops_per_module
    model.do_dummy_forward(force_eval=True)
  File "/home/lee/anaconda3/envs/py38/lib/python3.8/site-packages/nncf/nncf_network.py", line 693, in do_dummy_forward
    self._dummy_forward_fn(self)
  File "/home/lee/anaconda3/envs/py38/lib/python3.8/site-packages/nncf/dynamic_graph/graph_tracer.py", line 149, in default_dummy_forward_fn
    retval = model(*args, **kwargs)
  File "/home/lee/anaconda3/envs/py38/lib/python3.8/site-packages/nncf/dynamic_graph/wrappers.py", line 106, in wrapped
    return module_call(self, *args, **kwargs)
  File "/home/lee/anaconda3/envs/py38/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/home/lee/anaconda3/envs/py38/lib/python3.8/site-packages/nncf/debug.py", line 81, in decorated
    retval = forward_func(self, *args, **kwargs)
  File "/home/lee/anaconda3/envs/py38/lib/python3.8/site-packages/nncf/nncf_network.py", line 474, in forward
    retval = self.get_nncf_wrapped_model()(*args, **kwargs)
  File "/home/lee/anaconda3/envs/py38/lib/python3.8/site-packages/nncf/dynamic_graph/wrappers.py", line 108, in wrapped
    retval = module_call(self, *args, **kwargs)
  File "/home/lee/anaconda3/envs/py38/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/home/lee/projects/yolov5_modifed/models/yolo.py", line 117, in forward
    return self.forward_once(x, profile)  # single-scale inference, train
  File "/home/lee/projects/yolov5_modifed/models/yolo.py", line 148, in forward_once
    x = m(x)  # run
  File "/home/lee/anaconda3/envs/py38/lib/python3.8/site-packages/nncf/dynamic_graph/wrappers.py", line 108, in wrapped
    retval = module_call(self, *args, **kwargs)
  File "/home/lee/anaconda3/envs/py38/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/home/lee/projects/yolov5_modifed/models/common.py", line 138, in forward
    return self.cv3(torch.cat((self.m(self.cv1(x)), self.cv2(x)), dim=1))
  File "/home/lee/anaconda3/envs/py38/lib/python3.8/site-packages/nncf/dynamic_graph/wrappers.py", line 108, in wrapped
    retval = module_call(self, *args, **kwargs)
  File "/home/lee/anaconda3/envs/py38/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/home/lee/projects/yolov5_modifed/models/common.py", line 42, in forward
    return self.act(self.bn(self.conv(x)))
  File "/home/lee/anaconda3/envs/py38/lib/python3.8/site-packages/nncf/dynamic_graph/wrappers.py", line 108, in wrapped
    retval = module_call(self, *args, **kwargs)
  File "/home/lee/anaconda3/envs/py38/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/home/lee/anaconda3/envs/py38/lib/python3.8/site-packages/nncf/layer_utils.py", line 76, in forward
    results = forward_fn(proxy_module, *args)
  File "/home/lee/anaconda3/envs/py38/lib/python3.8/site-packages/nncf/layers.py", line 95, in _custom_forward_fn
    return self._conv_forward(input_, proxy_weight, proxy_padding_value)
  File "/home/lee/anaconda3/envs/py38/lib/python3.8/site-packages/nncf/layers.py", line 105, in _conv_forward
    return F.conv2d(input_, weight, self.bias, self.stride, self.padding, self.dilation, self.groups)
  File "/home/lee/anaconda3/envs/py38/lib/python3.8/site-packages/nncf/dynamic_graph/wrappers.py", line 86, in wrapped
    result = operator(*args, **kwargs)
RuntimeError: Given groups=1, weight of size [16, 64, 1, 1], expected input[24, 32, 160, 160] to have 64 channels, but got 32 channels instead

is something wrong?

justpi commented 3 years ago

It appears that the conv does not modify the input channel size.

vshampor commented 3 years ago

@mkaglins @evgeniya-egupova

vshampor commented 1 year ago

@daniil-lyakhov please check whether this still reproduces