使用Caffe 跑 Google 的Inception V2 对输入图片的shape有要求,某些shape输进去可能会报错。 
Inception model中有从conv和pooling层concat的操作,而conv和pooling的output输出计算方式不完全一样。解决方案: 
1. 按照原来prototxt输出图片 
2. 把concat层前面stride为2的conv层替换stride为1,再额外加上一个stride为2的pooling层 
e.g. 以 Inception v2 为例子InceptionBN 
conv_3c_3x3, conv_3c_double_3x3_1 
conv_4e_3x3, conv_4e_double_3x3_1 
然后再接上 stride 为2 的max pooling 层,这样几个分支出来的shape都会保持一致。

layer {
name: "conv_3c_3x3"
type: "Convolution"
bottom: "conv_3c_3x3_reduce"
top: "conv_3c_3x3"
convolution_param {
num_output: 240
kernel_size: 3
stride: 1
pad: 1
}
} layer {
name: "max_pool_3c_3x3"
type: "Pooling"
bottom: "conv_3c_3x3"
top: "conv_3c_3x3"
pooling_param {
pool: MAX
kernel_size: 3
stride: 2
pad: 0
}
}

这是取巧的做法,虽然保持了加载模型参数一致,但是增加了conv操作(stride变小)和多了一层pooling操作,会增加计算量和消耗显存。

caffe,Inception v2 Check failed: top_shape[j] == bottom[i]->shape(j)的更多相关文章

  1. 配置SSD-caffe测试时出现“Check failed: error == cudaSuccess (10 vs. 0) invalid device ordinal”解决方案

    这是由于GPU数量不匹配造成的,如果训练自己的数据,那么我们只需要将solver.prototxt文件中的device_id项改为自己的GPU块数,一块就是0,两块就是1,以此类推. 但是SSD配置时 ...

  2. npm 走 privoxy 代理经常出现 shasum check failed 的解决办法

    今天在下载一个比较大的项目,经常 shasum check failed ,太烦了,于是想切淘宝源,分别尝试 nrm 切换和传递 --registry ,结果都出现 Unexpected end of ...

  3. 经典分类CNN模型系列其五:Inception v2与Inception v3

    经典分类CNN模型系列其五:Inception v2与Inception v3 介绍 Inception v2与Inception v3被作者放在了一篇paper里面,因此我们也作为一篇blog来对其 ...

  4. caffe 训练时,出现错误:Check failed: error == cudaSuccess (4 vs. 0) unspecified launch failure

    I0415 15:03:37.603461 27311 solver.cpp:42] Solver scaffolding done.I0415 15:03:37.603549 27311 solve ...

  5. caffe: test code 执行出问题: Check failed: FLAGS_weights.size() > 0 (0 vs. 0) Need model weights to score.

    Check failed: FLAGS_weights.size() > 0 (0 vs. 0) Need model weights to score. 出现这个错误,但是我记得昨天还好好的, ...

  6. windows7下解决caffe check failed registry.count(type) == 1(0 vs. 1) unknown layer type问题

    在Windows7下调用vs2013生成的Caffe静态库时经常会提示Check failed: registry.count(type) == 1 (0 vs. 1) Unknown layer t ...

  7. 【神经网络与深度学习】Caffe训练执行时爆出的Check failed: registry.count(t ype) == 1 (0 vs. 1) Unknown layer type

    自己建立一个工程,希望调用libcaffe.lib ,各种配置好,也能成功编译,但是运行就会遇到报错 F0519 14:54:12.494139 14504 layer_factory.hpp:77] ...

  8. caffe: test code Check failed: K_ == new_K (768 vs. 1024) Input size incompatible with inner product parameters.

    I0327 20:24:22.966171 20521 net.cpp:849] Copying source layer drop7I0327 20:24:22.966179 20521 net.c ...

  9. caffe运行错误: im2col.cu:61] Check failed: error == cudaSuccess (8 vs. 0) invalid device function

    错误: im2col.cu:61] Check failed: error == cudaSuccess (8 vs. 0)  invalid device function 原因:由于Makefil ...

随机推荐

  1. MYSQL常用函数(格式化函数)

    DATE_FORMAT(date,fmt)  依照字符串fmt格式化日期date值 FORMAT(x,y)   把x格式化为以逗号隔开的数字序列,y是结果的小数位数 INET_ATON(ip)   返 ...

  2. Nginx自学笔记

    Nginx相关 标签(空格分隔): nginx 享学 安装部署 通过源代码的方式安装 使用 ./sbin/nginx #启动 ./sbin/nginx -t #检查是否有错 ./sbin/nginx ...

  3. 初探nginx负载均衡配置

    只简单说一下upstream的配置,如何进行负载均衡后续还需要多了解 1.另准备一个配置文件命名为nginx_test.conf 为了不污染原有的nginx.conf,提前复制一份配置文件做试验,然后 ...

  4. 20171205xlVBA往返航班组合

    'ClassPlan Public Org As String Public Des As String Public FlyNo As String Public StartDate As Vari ...

  5. 网站访问出现 ------ Can not write to cache files, please check directory ./cache/ .

    最近在搞微商城时,突然出现了Can not write to cache files, please check directory ./cache/ .这样一个提示, 但最近好像没搞什么大动作,怎么 ...

  6. Vue引入jQuery

    1.在项目中安装jquery npm install jquery --save-dev 或者 打开package.json文件,在里面加入这行代码,jquery后面的是版本,根据你自己需求更改. d ...

  7. call、apply、bind三者的区别

    先构造函数let xiaowang={ name1:"小王", age:", sex:"男", say:function(){ console.log ...

  8. Notes for GGplot2: Getting started with ggplot2

    Alpha-ma 2016/10/7 1 Introduction of GGplot2 ggplot2 is an R package for producing statistical, or d ...

  9. SpringBoot系列之Hikari连接池

    1.springboot 2.0 中默认连接池是Hikari,在引用parents后不用专门再添加依赖 2.application.yml中的配置 # jdbc_config datasource s ...

  10. [洛谷 P3788] 幽幽子吃西瓜

    妖梦费了好大的劲为幽幽子准备了一个大西瓜,甚至和兔子铃仙打了一架.现在妖梦闲来无事,就蹲在一旁看幽幽子吃西瓜.西瓜可以看作一个标准的球体,瓜皮是绿色的,瓜瓤是红色的,瓜皮的厚度可视为0.妖梦恰好以正视 ...