assert (boxes[:, 2] >= boxes[:, 0]).all()报错
根据报错信息,打印以下内容:
代码如下:
for i in xrange(num_images):
#print ('in append_flipped==================',self.roidb)
boxes = self.roidb[i]['boxes'].copy()
oldx1 = boxes[:, 0].copy()
oldx2 = boxes[:, 2].copy()
boxes[:, 0] = widths[i] - oldx2 - 1
boxes[:, 2] = widths[i] - oldx1 - 1
try:
assert (boxes[:, 2] >= boxes[:, 0]).all()
except:
print ('in append_flipped==================',self.roidb[i]['boxes'],boxes[:, 0],boxes[:, 2],widths[i],oldx2)
其中,self.roidb是从标记的框那里得来的。这个代码的目的是旋转图片还能得到框,是一个数据增强的做法。
打印出来后,能看到是哪些异常数据导致这个assert的。这个assert (boxes[:, 2] >= boxes[:, 0]).all()
的意思是:右下角的值应该比左上角的值大。这样才是一个正确的框。
常见的数据错误有:
1)数据越界了。这个跟数据清洗有关。有可能标记的时候。图片的宽只有1000,硬是变成了左上角 990,框的宽度20。加在一起就是1010.越界了。
assert (boxes[:, 2] >= boxes[:, 0]).all()报错的更多相关文章
- Tomcat7.0启动报错:java.lang.illegalargumentexception:taglib definition not consisten with specification version
Tomcat7.0启动报错:java.lang.illegalargumentexception:taglib definition not consisten with specification ...
- wince6.0 编译报错:"error C2220: warning treated as error - no 'object' file generated"的解决办法
内容提要:wince6.0编译报错:"error C2220: warning treated as error - no 'object' file generated" 原因是 ...
- AndroidStudio3.0 注解报错Annotation processors must be explicitly declared now. The following dependencies on the compile classpath are found to contain annotation processor.
把Androidstudio2.2的项目放到3.0里面去了,然后开始报错了. 体验最新版AndroidStudio3.0 Canary 8的时候,发现之前项目的butter knife报错,用到注解的 ...
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">报错
https://blog.csdn.net/qq_36611526/article/details/79067159 今天遇到个问题 文件内引入某个资源 pom.xml头部http://maven.a ...
- 01-路由跳转 安装less this.$router.replace(path) 解决vue/cli3.0语法报错问题
2==解决vue2.0里面控制台包的一些语法错误. https://www.jianshu.com/p/5e0a1541418b 在build==>webpack.base.conf.j下注释掉 ...
- maven项目解决pom.xml头部 http://maven.apache.org/xsd/maven-4.0.0.xsd报错的问题
版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明.本文链接:https://blog.csdn.net/qq_36611526/article/d ...
- vc++6.0各种报错合集(附:VC++6.0调出打印窗口的方法)
背景: 由于VC++6.0对于现在的我来说,只是一个工具,暂时没有太多的时间分配到这块去深究它,由于不明其原理,因此也只是在此把错误积累下来,以备下次相同错误出现时能快速排除,节省时间. 正文 一.出 ...
- Microsoft.ReportViewer.WebForms, Version=10.0.0.0的报错问题,解决方案
未能加载文件或程序集,或者web.config报错! 已解决:直接找到(默认在 路径/Microsoft Visual Studio 8/ReportViewer).把里面的3个DLL传上去就OK了! ...
- 未能加载文件或程序集 Newtonsoft.Json, Version=4.5.0.0 的报错,解决方法
使用httpclient测试webapi的时候客户端报错: {"未能加载文件或程序集“Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, P ...
随机推荐
- 巴黎游戏周: PS4独占游戏《重力少女2》
http://blog.us.playstation.com/2015/10/27/gravity-rush-2-coming-to-north-america-on-ps4/
- 使用C#的aforge类库识别验证码实例
一: 验证码处理 1. 一般处理原则 这种验证码为什么说跟没有一样,第一点:字体规范工整,第二点:不旋转扭曲粘连,第三点:字体颜色单一,下面看处理步骤. 这里要注意的是,aforge只接受像素格式为 ...
- Application、QueryString、session、cookie、ViewState、Server.Transfer等
Application: WebForm1.aspx: protected void Button1_Click(object sender, EventArgs e) { ; Response.Re ...
- java 实现小数取最后一位、四舍五入
//获得最后一位 double a = 3.24; String b = String.valueOf(a); char c[] = b.toCharArray(); System.out.print ...
- jquery对append进的元素的监听操作
通常append是再页面加载完之后才加入进去的,此时使用click方法是没有效果的,应使用document.on来实现对元素的监听. 例: $(document).on("click&quo ...
- Win7下,nginx默认80端口被System占用,造成nginx启动报错
在win7 32位旗舰版下,启动1.0.8版本nginx,显示如下错误: 2012/04/02 13:55:59 [emerg] 7864#2376: bind() to 0.0.0.0:80 fai ...
- 函数中不能对全局变量进行修改,想要修改全局变量需要在变量前面加global
# def change_name(name):# global school # school = "Mage Linux"# print(&quo ...
- bzoj5109: [CodePlus 2017]大吉大利,晚上吃鸡!
Description 最近<绝地求生:大逃杀>风靡全球,皮皮和毛毛也迷上了这款游戏,他们经常组队玩这款游戏.在游戏中,皮皮 和毛毛最喜欢做的事情就是堵桥,每每有一个好时机都能收到不少的快 ...
- centos7安装rabbitmq3.7.9
感谢此兄: https://blog.51cto.com/huwei555/2341513?source=dra (centos7 安装rabbitmq 3.7) 以root用户登录.cd /hom ...
- nginx1.14.0日志打印
nginx日志打印 http属性log_format来设置日志格式 ,参考 https://www.jb51.net/article/52573.htm <nginx日志配置指令详解> ...