Gumpest / YOLOv5-Multibackbone-Compression

YOLOv5 Series Multi-backbone(TPH-YOLOv5, Ghostnet, ShuffleNetv2, Mobilenetv3Small, EfficientNetLite, PP-LCNet, SwinTransformer YOLO), Module(CBAM, DCN), Pruning (EagleEye, Network Slimming), Quantization (MQBench) and Deployment (TensorRT, ncnn) Compression Tool Box.
989 stars 201 forks source link

local variable 'stride' referenced before assignment #85

Open Ri-Bai opened 2 years ago

Ri-Bai commented 2 years ago
return flops * img_size[0] / stride * img_size[1] / stride

UnboundLocalError: local variable 'stride' referenced before assignment

zhoujialos commented 2 years ago

在if上添加一行stride=max(int(model.stride.max()), 32) if hasattr(model, 'stride') else 32试试

kawa11 commented 1 year ago

相同问题