用ms rcnn训练出的模型进行预测时提示缺少工具
报错信息如下:
Traceback (most recent call last): File "demo/predict.py", line 8, in <module> from predictor import COCODemo File "/home/zhhu/wjy/mask_scoring_R-CNN/maskscoring_rcnn/demo/predictor.py", line 11, in <module> from maskrcnn_benchmark.utils import cv2_util ImportError: cannot import name 'cv2_util'
解决办法:
去github下载maksrcnn-benchmark:https://github.com/facebookresearch/maskrcnn-benchmark。将这个util目录下的cv2_util.py给拷贝到maskscoring_rcnn\maskrcnn_benchmark\utils下即可。
如果还报错:
Traceback (most recent call last): File "demo/predict.py", line 8, in <module> from predictor import COCODemo File "/home/zhhu/wjy/mask_scoring_R-CNN/maskscoring_rcnn/demo/predictor.py", line 411, in <module> from maskrcnn_benchmark.structures.keypoint import PersonKeypoints ModuleNotFoundError: No module named 'maskrcnn_benchmark.structures.keypoint'
解决方法同理: