Incompatible shapes during the half way training---Invalid argument: Incompatible shapes: [1,63,4] vs. [1,64,4]
这是tensorflow model 中我使用它的faster--cnn,但是就是训练过程中,代码执行到一半
一般是step=40~120的时候就报错了:
INFO:tensorflow:global step 65: loss = 4.8004 (0.854 sec/step)
INFO:tensorflow:global step 66: loss = 0.2637 (0.868 sec/step)
INFO:tensorflow:global step 67: loss = 1.5711 (0.845 sec/step)
INFO:tensorflow:global step 68: loss = 0.2334 (0.866 sec/step)
INFO:tensorflow:global step 69: loss = 0.6833 (0.846 sec/step)
2017-07-11 14:47:16.293535: W tensorflow/core/framework/op_kernel.cc:1158] Invalid argument: Incompatible shapes: [1,63,4] vs. [1,64,4] 这种错误tensorflow model issue上面也有解介绍,主要
解决方案是
1、labels的class要从1开始不要从0开始,
或者
2、对于边界框0.00,0.99,改成0.01,0.98之类的避免边界, 但是上面基本不起作用,我还一直以为是自己数据的问题,毕竟我是用自己数据的且类别只有1类,
这样检查数据,看是训练到哪个图像就停止,然后返回查看是不是标注的框少了,多了,在边界等
情况,但是发现这是一个随机性的error。
最后面只能靠自己了,老老实实查看error的部分,然后traceback:
发现是这里出的错:
diff = prediction_tensor - target_tensor 一个是 [1,63,4] ,一个是[1,64,4],我们明明设置是64呀,怎么回事,跑出63????????
只能沿着向量流tensorflow to traceback:
发现这样一段代码:
refined_box_encodings_masked_by_class_targets = tf.boolean_mask(
refined_box_encodings_with_background,
tf.greater(flat_cls_targets_with_background, 0)) 哎呀,这里就是把64变成63的万恶之源呀!!!!!!!!,我就不明白了,为什么这里这么明显是可能出问题的呀,
我又想,代码是自己改的,没有和github同步,会不会作者更新了嘞??? 然后就去github1上面看作者的源码和本地对比,果然!!!!!!
refined_box_encodings_masked_by_class_targets = tf.boolean_mask(
refined_box_encodings_with_background,
tf.greater(one_hot_flat_cls_targets_with_background, 0)) 不一样,然后发现开发者做了一些改动,我就看他们的改动按照自己的来改,果然,ok了,其中开发者还加了一个注释:
# For anchors with multiple labels, picks refined_location_encodings
# for just one class to avoid over-counting for regression loss and
# (optionally) mask loss. 是吧,后面阔以啦,具体开发者代码在:faster_rcnn_meta_arch.py _loss_box_classifier函数里哈
链接https://github.com/tensorflow/models/blob/master/research/object_detection/meta_architectures/faster_rcnn_meta_arch.py
Incompatible shapes during the half way training---Invalid argument: Incompatible shapes: [1,63,4] vs. [1,64,4]的更多相关文章
- format %x invalid or incompatible with argument问题解决方法
现在还有好多朋友在用Protel 99se来画图,可是在现在的双核或四核电脑上运行Protel出现错误并且弹出对话框:“format '%x' invalid or incompatible with ...
- file_put_contents 错误:failed to open stream: Invalid argument 一种原因
今天在测试nilcms系统的时候,出现了一个报错,导致缓存无法更新: file_put_contents(C:\UPUPW_AP5.4\vhosts\d.tv\NilCMS_APP\include_r ...
- fdisk添加分区引起的Linux Error: 22: Invalid argument
在Linux服务器(虚拟机)上使用fdisk添加分区.格式化分区后,遇到了Linux Error: 22: Invalid argument错误,操作步骤如下所示 [root@oracle-serve ...
- -bash: ulimit: pipe size: cannot modify limit: Invalid argument
从root账号切换到oracle账号时,出现了"-bash: ulimit: pipe size: cannot modify limit: Invalid argument"提示 ...
- 【安卓】aidl.exe E 10744 10584 io_delegate.cpp:102] Error while creating directories: Invalid argument
这几天在使用.aidl文件的时候eclipse的控制台总是爆出如下提示: aidl.exe E 10744 10584 io_delegate.cpp:102] Error while creatin ...
- php foreach 语法的遍历来源数组如果不是一个有效数组php会出现错误警告 Invalid argument supplied for foreach()
在php中,foreach语法的遍历来源数组如果不是一个有效数组,php会出现错误警告 Invalid argument supplied for foreach() ,但是很多时候这个数组是取自某些 ...
- Yii 提示Invalid argument supplied for foreach() 等错误
Yii 提示Invalid argument supplied for foreach() 或者 undefined variable: val等错误 只需要在对应的文件中加入error_report ...
- write函数出错返回invalid argument(EINVAL)问题
还是在下载机上面遇到的. 话说为了长久的下载,后面又买了个16G的U盘格成EXT3放在角落下载,结果发现总是有几个种子在下载的时候会出错提示invalid argument. 之前也出过一样的错误提示 ...
- PHP--Warning: Invalid argument supplied for foreach() in ...
1.背景 今天学习PHPExcel的使用,在代码执行foreach($data as $value){...}的时候出现这样一个警告提示:Warning: Invalid argument suppl ...
随机推荐
- mysql短日期 长时间转换为短日期
fabutime 2018-09-26 15:27:03 date_format( fabutime,\'%Y-%m-%d\') as fabutime fabutime 2018-09-2 ...
- DIV左、右布局
1.右边宽度固定,左边自适应 第一种(flex布局,不兼容IE9以下浏览器): <style> body { display: flex; } .left { background-col ...
- ASCII、Unicode和UTF-8
转自廖雪峰的官方网站:https://www.liaoxuefeng.com/wiki/001374738125095c955c1e6d8bb493182103fac9270762a000/00138 ...
- 造excel表格横、列数据每一格自动累加填充效果
1.需求 excel每个横格子和竖格子number数据不一致的情况,保持如下金额字段每次自动累加 2.步骤: 1)设置excel格子为number格式(可以不要小数) 2)选中需要增序的单元格,选择e ...
- linux下部署jdk+Tomcat
部署jdk (如果是普通用户,先切换到管理员 su root) 1.下载jdk压缩包 2.用xftp将jdk压缩包传输 /opt 目录下 3.解压(在/opt 目录下对压缩包解压) tar -xzvf ...
- 零基础学习python_模块(50-52课)
今天学了下模块,那什么是模块呢?其实我们写的以py结尾的一个文件就是一个模块,模块也就是程序 还记得我们之前学过容器.函数.类吧 容器 -> 数据的封装 函数 -> ...
- months_between
select months_between(to_date('2016.01.29','yyyy.mm.dd'), to_date('2016.02.29','yyyy.mm.dd')) from ...
- hadoop的块
http://hadoop.apache.org/docs/r1.0.4/cn/hdfs_design.html http://www.cnblogs.com/cloudma/articles/had ...
- ubuntu编译安装nginx
下载nginx源码, ./configure --prefix=/usr/local/nginx/1.8 --with-http_ssl_module --with-http_dav_module - ...
- PHP 字符串两边填充补零
str_pad顾名思义这个函数是针对字符串来说的这个可以对指定的字符串填补任何其它的字符串 例如:str_pad(带填补的字符串,填补后的长度,填补字符串,填补位置) 其中填补后的长度必须是个正整数, ...