问题描述
我想使用预先训练的模型(mask_rcnn_R_50_FPN_3x.yaml)运行demo.py,该模型已在Colab中完成并保存为.pth
所以当我在带演示的colab中运行以下内容
!python demo.py --config-file /content/detectron2/configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml --input [DIR INPUT] --output [DIR OUTPUT] --confidence-threshold 0.7 --opts MODEL.WEIGHTS [DIR PATH].pth
我将图像输出到DIR OUTPUT,但是,它没有检测到我在Colab中训练过的模型,并且得到了以下警告
WARNING [08/23 15:10:22 fvcore.common.checkpoint]: Skip loading parameter 'backbone.bottom_up.res2.0.conv1.weight' to the model due to incompatible shapes: (256,64,1,1) in the checkpoint but (64,1) in the model! You might want to double check if this is expected.
WARNING [08/23 15:10:22 fvcore.common.checkpoint]: Skip loading parameter 'backbone.bottom_up.res2.0.conv1.norm.weight' to the model due to incompatible shapes: (256,) in the checkpoint but (64,) in the model! You might want to double check if this is expected.
WARNING [08/23 15:10:22 fvcore.common.checkpoint]: Skip loading parameter 'backbone.bottom_up.res2.0.conv1.norm.bias' to the model due to incompatible shapes: (256,) in the model! You might want to double check if this is expected.
WARNING [08/23 15:10:22 fvcore.common.checkpoint]: Skip loading parameter 'backbone.bottom_up.res2.0.conv1.norm.running_mean' to the model due to incompatible shapes: (256,) in the model! You might want to double check if this is expected.
似乎需要用于训练模型的配置,但是我不确定还需要在命令行中添加什么。抱歉,我是detectron2的新手,正在边做边学。
请支持
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)