Git Product home page Git Product logo

Comments (8)

soeaver avatar soeaver commented on May 12, 2024

All the pre-train models fit 224x224 input, you just need to modify the deploy file's input layer to 224x224.

from caffe-model.

yja1 avatar yja1 commented on May 12, 2024

I download this https://pan.baidu.com/s/1c6D150 inception_v4 caffemodel. my datasets is face,so my data size is 11296 and 160132(trained use small centerloss model). i try 224224 size, the result not well. until now the best result is 160132 size.
today i want try inception_v4 model to train my face data (size 160*132). when i train, has error "Check failed: top_shape[j] == bottom[i]->shape(j)". i try many size, the most small size is 239x239 can run. if i train from premodel the size must 299x299 can run.

Thank you very much for your reply!

from caffe-model.

soeaver avatar soeaver commented on May 12, 2024

This error is caused by the different feature maps rounding methods of the convolution layer and the pooling layer in caffe.
I think https://github.com/BVLC/caffe/pull/3057/files may be useful for you

from caffe-model.

shicai avatar shicai commented on May 12, 2024

路过,其实LZ可以用中文问,应该没问题的。。。
(@yja1 you can ask your questions in Chinese...)

引起这个问题的根本原因在于Inception的精细设计,和原始Caffe之间的一小点不兼容。
Caffe的Conv在计算Feature Map的时候使用floor函数取整,而Pooling是使用ceil函数取整。
Inception虽然是全卷积的网络,但是其精细的设计(Conv和Pooling并行降采样Concat),要求在输入的时候要求Input size尽量是32x+43这样的一个数值(对应299的输入,x=8)。在Caffe中,当输入不是这样数值的时候,Conv和Pooling并行降采样时候,输入大小相同,但是取整函数不同导致输出大小不相同,所以报shape的错。

所以,PR3057在考虑对以往Caffe兼容性的前提下,给Pooling层引入一个新的参数ceil_mode(默认true兼容以前的模型),来判断Pooling的时候到底是采用floor还是ceil取整。这样可以更好地处理TensorFlow和Torch训练转换过来的模型(因为它们的Pooling默认是用floor取整的)。

from caffe-model.

soeaver avatar soeaver commented on May 12, 2024

@shicai 哈哈,确实中文问就好了
caffe这点确实很烦人,感谢你的补充

from caffe-model.

yja1 avatar yja1 commented on May 12, 2024

可以跑了。谢谢啦~ (我问的时候还寻思呢,是用中文呢,让大神去翻译再回答,还是用自己的农村英语呢)

from caffe-model.

shz0519 avatar shz0519 commented on May 12, 2024

@soeaver @yja1 您好!我在训练inception-v4时并没有报这个错误,但是在测试阶段却报:
Check failed: top_shape[j] == bottom[i]->shape(j) (25 vs. 26) All inputs must have the same shape, except at concat_axis.
按照https://github.com/BVLC/caffe/pull/3057/files的方法修改并重新编译caffe后还是报同样的错误,我的input size为224*224,这是为什么呢

from caffe-model.

shz0519 avatar shz0519 commented on May 12, 2024

是否要将设置ceil_mode改为false呢?在哪修改呢?

from caffe-model.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.