Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

caffe train -solver error: Check failed: bottom[i]->shape() == bottom[0]->shape() #19

Closed
SergeMv opened this issue Jul 11, 2017 · 2 comments

Comments

@SergeMv
Copy link

SergeMv commented Jul 11, 2017

Hi Timo,

Got this when was running this command:
/root/ENet/caffe-enet/build/tools/caffe train -solver /root/ENet/prototxts/enet_solver_encoder.prototxt

I0711 14:14:57.111349 209 net.cpp:100] Creating Layer eltwise2_0_4
I0711 14:14:57.111353 209 net.cpp:434] eltwise2_0_4 <- drop2_0_3
I0711 14:14:57.111371 209 net.cpp:434] eltwise2_0_4 <- bn2_0_4
I0711 14:14:57.111377 209 net.cpp:408] eltwise2_0_4 -> eltwise2_0_4
F0711 14:14:57.111387 209 eltwise_layer.cpp:34] Check failed: bottom[i]->shape() == bottom[0]->shape()
*** Check failure stack trace: ***
@ 0x7f6f05d78daa (unknown)
@ 0x7f6f05d78ce4 (unknown)
@ 0x7f6f05d786e6 (unknown)
@ 0x7f6f05d7b687 (unknown)
@ 0x7f6f0644fbbd caffe::EltwiseLayer<>::Reshape()
@ 0x7f6f06317835 caffe::Net<>::Init()
@ 0x7f6f063186c5 caffe::Net<>::Net()
@ 0x7f6f063296ca caffe::Solver<>::InitTrainNet()
@ 0x7f6f0632a8dc caffe::Solver<>::Init()
@ 0x7f6f0632ac0a caffe::Solver<>::Solver()
@ 0x7f6f062eab23 caffe::Creator_AdamSolver<>()
@ 0x411fd6 caffe::SolverRegistry<>::CreateSolver()
@ 0x40af52 train()
@ 0x40898c main
@ 0x7f6f0456ef45 (unknown)
@ 0x409293 (unknown)
@ (nil) (unknown)
Aborted (core dumped)

What could be wrong?

@TimoSaemann
Copy link
Owner

TimoSaemann commented Jul 11, 2017

I think the problem is your image size. The image size needs to be divisible three times by 2 without remainder. For example:

input image size: 1024x512
after first pool: 512x256
after second pool: 256x128
after third pool: 128x64

after first upsample: 256x128
after second upsample: 512x256
after third upsample: 1024x512 (the same size as your input image)

If your input image has for example 500x220 :

after first pool: 250x110
after second pool: 125x65
after third pool: 63x33

after first upsample: 126x66
after second upsample: 252x132
after third upsample: 504x264 (not the same size as your input image) 

Somewhere in the net you get this error: Check failed: bottom[i]->shape() == bottom[0]->shape()

In general it should be possible to use every image size, but you have to adapt the network with padding. For example you can expand the upsample_param with upsample_w and upsample_h (cf. alexgkendall/SegNet-Tutorial#37).

@SergeMv
Copy link
Author

SergeMv commented Jul 11, 2017

Yes, I changed the image size and it looks like this step is working. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants