据说yolov5
原来的FLOPS
计算脚本有bug,因此这个大神推荐使用thop
库进行计算,代码如下:
input = torch.randn(1, 3, 416, 416)
flops, params = thop.profile(model, inputs=(input,))
print('flops:', flops / 900000000*2)
print('params:', params)
收藏在这里,方便以后需要算yolov5等模型的FLOPS时使用;
本文章来源
- 知乎pogg:YOLOv5-Lite:更轻更快易于部署的YOLOv5