我正在努力让Detectron2的演示代码在我的笔记本电脑上本地工作。一切看起来都运行正常,但没有检测到任何对象实例,即使我使用Colab演示中的图像。
我在一台非GPU Mac上运行。我跟踪安装说明来安装Detectron。我的机器上有以下模块版本:
我从Detectron的github抄袭了demo.py,predictor.py,mask_rcnn_R_101_FPN_3x.yaml和Base FPN.yaml。然后我运行用预训练的模型命令进行推理演示。具体的命令是:
python demo.py --input 000000439715.jpeg --output output --config-file mask_rcnn_R_101_FPN_3x.yaml --opts MODEL.WEIGHTS detectron2://COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x/137849600/model_final_f10217.pkl MODEL.DEVICE cpu000000439715.jpeg是来自Colab笔记本演示的马背男子的样本图像。输出的最后一行是
000000439715.jpeg: detected 0 instances in 6.77s输出目录中的图像没有注释。
在我看来,日志输出没问题。唯一可能表明问题的是顶部的警告。
[08/28 12:35:18 detectron2]: Arguments: Namespace(confidence_threshold=0.5, config_file='mask_rcnn_R_101_FPN_3x.yaml', input=['000000439715.jpeg'], opts=['MODEL.WEIGHTS', 'detectron2://COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x/137849600/model_final_f10217.pkl', 'MODEL.DEVICE', 'cpu'], output='output', video_input=None, webcam=False)
[08/28 12:35:18 fvcore.common.checkpoint]: [Checkpointer] Loading from detectron2://COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x/137849600/model_final_f10217.pkl ...
[08/28 12:35:18 fvcore.common.checkpoint]: Reading a file from 'Detectron2 Model Zoo'
WARNING [08/28 12:35:19 fvcore.common.checkpoint]: Some model parameters or buffers are not found in the checkpoint:不过,我不知道该怎么办。
我试着不指定模型的权重。我还试着把信心门槛设为零。我也得到了同样的结果。
我做错了什么吗?接下来的调试步骤是什么?
发布于 2022-12-03 11:45:04
我和你遇到了同样的问题,就像:
WARNING [xxxxxxxxx fvcore.common.checkpoint]: Some model parameters or buffers are not found in the checkpoint:这个警告让我的结果非常糟糕。最后,我发现我使用了一个错误的重量文件。希望这能帮到你。
https://stackoverflow.com/questions/68966792
复制相似问题