mmdetection中的benchmark使用问题
使用版本
mmcv = 2.1.0
mmdet = 3.2.0
测试模型
python tools/analysis_tools/benchmark.py \
configs/faster_rcnn/faster-rcnn_r50_fpn_1x_coco.py \
checkpoints/faster_rcnn_r50_fpn_1x_coco_20200130-047c8118.pth --fuse-conv-bn
遇到的问题
1.空类'NoneType'调用错误
AttributeError: 'NoneType' object has no attribute 'Process'
解决方法:
安装psutil模块 pip install psutil
2.FPS结果过大的问题
Overall fps: 326.7 batch/s, times per batch: 3.1 ms/batch, batch size: 1, num_workers: 2
计算出的FPS为300多帧,明显不正常
解决方法
benchmark.py默认参数错误
将 default='dataloader ',中 dataloader 改成 inference
改变后才会调用定义的模型,执行对应的推理程序计算真实帧率
结果
Done image [150/2000], fps: 15.4 img/s, times per image: 65.0 ms/img, cuda memory: 542 MB
结果接近真实值
总结
有写的不好的地方,感想大家指正!