Alexnet With Images Smaller Than Crop Size

644 views
Skip to first unread message

bowren...@gmail.com

unread,
May 20, 2016, 7:50:58 PM5/20/16
to Caffe Users
I am trying to train Alexnet on images smaller than the default crop size of 227x227, but when training I get the error at the bottom of this message. Is changing the crop_size feasible with Alexnet? I tried scaling my images up to 227x227, but it slows down training significantly.

*** Aborted at 1463787518 (unix time) try "date -d @1463787518" if you are using GNU date ***
PC: @     0x7f9e521d109e caffe::Blob<>::Reshape()
*** SIGFPE (@0x7f9e521d109e) received by PID 2566 (TID 0x7f9e52709a00) from PID 1377636510; stack trace: ***
    @     0x7f9e5179f8d0 (unknown)
    @     0x7f9e521d109e caffe::Blob<>::Reshape()
    @     0x7f9e521d146a caffe::Blob<>::Reshape()
    @     0x7f9e5215b16d caffe::PoolingLayer<>::Reshape()
    @     0x7f9e5221437f caffe::Net<>::Init()
    @     0x7f9e52215df8 caffe::Net<>::Net()
    @     0x7f9e522571a2 caffe::Solver<>::InitTrainNet()
    @     0x7f9e52258722 caffe::Solver<>::Init()
    @     0x7f9e52258a7a caffe::Solver<>::Solver()
    @     0x7f9e521fa9a3 caffe::Creator_SGDSolver<>()
    @           0x4129ec caffe::SolverRegistry<>::CreateSolver()
    @           0x40a7ed train()
    @           0x407ec3 main
    @     0x7f9e4d58ab45 (unknown)
    @           0x408708 (unknown)
    @                0x0 (unknown)

Ahmed Ibrahim

unread,
May 23, 2016, 2:31:15 PM5/23/16
to Caffe Users
the network is designed such that the pooling layers reduces the input 227*227 gradually all the way to the end , if your input is much smaller than 227*227 then it will vanish quickly and cause errors, the solutions is to scale as you mentioned or play in the network architecture (mainly the strides)  like if you have a pool layer with stride:4 try to reduce this number to 3 or 2 , but then this will not be alexnet you can call it "alexnet-inspired"

bowren...@gmail.com

unread,
May 23, 2016, 3:17:45 PM5/23/16
to Caffe Users
Thanks, that makes sense. I'll see if I can get a hold of a GPU for quicker training.
Reply all
Reply to author
Forward
0 new messages