这是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]的更多相关文章

  1. format %x invalid or incompatible with argument问题解决方法

    现在还有好多朋友在用Protel 99se来画图,可是在现在的双核或四核电脑上运行Protel出现错误并且弹出对话框:“format '%x' invalid or incompatible with ...

  2. file_put_contents 错误:failed to open stream: Invalid argument 一种原因

    今天在测试nilcms系统的时候,出现了一个报错,导致缓存无法更新: file_put_contents(C:\UPUPW_AP5.4\vhosts\d.tv\NilCMS_APP\include_r ...

  3. fdisk添加分区引起的Linux Error: 22: Invalid argument

    在Linux服务器(虚拟机)上使用fdisk添加分区.格式化分区后,遇到了Linux Error: 22: Invalid argument错误,操作步骤如下所示 [root@oracle-serve ...

  4. -bash: ulimit: pipe size: cannot modify limit: Invalid argument

    从root账号切换到oracle账号时,出现了"-bash: ulimit: pipe size: cannot modify limit: Invalid argument"提示 ...

  5. 【安卓】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 ...

  6. php foreach 语法的遍历来源数组如果不是一个有效数组php会出现错误警告 Invalid argument supplied for foreach()

    在php中,foreach语法的遍历来源数组如果不是一个有效数组,php会出现错误警告 Invalid argument supplied for foreach() ,但是很多时候这个数组是取自某些 ...

  7. Yii 提示Invalid argument supplied for foreach() 等错误

    Yii 提示Invalid argument supplied for foreach() 或者 undefined variable: val等错误 只需要在对应的文件中加入error_report ...

  8. write函数出错返回invalid argument(EINVAL)问题

    还是在下载机上面遇到的. 话说为了长久的下载,后面又买了个16G的U盘格成EXT3放在角落下载,结果发现总是有几个种子在下载的时候会出错提示invalid argument. 之前也出过一样的错误提示 ...

  9. PHP--Warning: Invalid argument supplied for foreach() in ...

    1.背景 今天学习PHPExcel的使用,在代码执行foreach($data as $value){...}的时候出现这样一个警告提示:Warning: Invalid argument suppl ...

随机推荐

  1. 《Linux 性能及调优指南》1.6 了解Linux性能指标

    翻译:飞哥 (http://hi.baidu.com/imlidapeng) 版权所有,尊重他人劳动成果,转载时请注明作者和原始出处及本声明. 原文名称:<Linux Performance a ...

  2. vue获取dom

    //使用ref属性来获取当前的div的dom属性 <div class="list" ref="wrapper"></div> //在j ...

  3. Linux 安装redis 基本配置 发布订阅,安全配置,持久化 rdb ,aof

    redis redis相关配置1.yum  源码 rpm  yum 快速,间接,高效,解决依赖关系,(自动安装到某个路径,不可控),通过yum安装的软件查询命令 rpm -ql nginx  yum源 ...

  4. linux socket使用情况 ss -s ss -t -a | cat /proc/net/socketstat

    Linux系统中,查看SOCKET使用情况可以使用ss命令. 1.命令格式:ss [参数]ss [参数] [过滤]2.命令功能:ss(Socket Statistics的缩写)命令可以用来获取 soc ...

  5. 重识linux-linux的新增与删除用户组和切换命令

    重识linux-linux的新增与删除用户组 1 相关文件 /etc/group /etc/gshadow 2操作相关 groupadd group1 groupmod group1 groupdel ...

  6. 开源 人脸识别 openface 实用介绍 实例演示 训练自己的模型

    1.OpenFace 是 卡耐基梅陇(CMU)大学的一个图像+机器学习项目,整体程序包含:人脸发现,特征提取,特征神经网络训练,人脸识别这四部分. github   https://github.co ...

  7. WebForm多页面传值跳转

    一.URL传值 URL传值是利用跳转地址直接加变量定义内容 格式:跳转地址?任意变量=传的值--?=之间不能有空格 多条数据传值 在地址栏继续拼接&key=value void Button1 ...

  8. EventBus用法

    什么是EventBus EventBus是一个Android端优化的publish/subscribe消息总线,简化了应用程序内各组件间.组件与后台线程间的通信.比如请求网络,等网络返回时通过Hand ...

  9. c# word操作

    合并单元格  http://www.360doc.com/content/11/0729/21/2097544_136620405.shtml

  10. MongoTemplate的使用

    参考:  https://www.cnblogs.com/ityouknow/p/6828919.html