微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

无法在Colab上运行对象检测代码

如何解决无法在Colab上运行对象检测代码

我想使用预先训练的模型(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 举报,一经查实,本站将立刻删除。

相关推荐


Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其他元素将获得点击?
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。)
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbcDriver发生异常。为什么?
这是用Java进行XML解析的最佳库。
Java的PriorityQueue的内置迭代器不会以任何特定顺序遍历数据结构。为什么?
如何在Java中聆听按键时移动图像。
Java“Program to an interface”。这是什么意思?