BVLC/caffe — pull request #1048 by jyegerlehner (2014-09-08 04:40:25+00:00)
Title: Conv layer: fix crash by setting weight pointer

The problem is that in ConvolutionLayer::Backward_[gpu,cpu], the pointer "weight" is set only if the this->param_propagate_down_[0] is true, otherwise it is left NULL. However "weight" is used if either this->param_propagate_down_[0] or propagate_down[i] is true. So in the case where the first bool is false but the second is true, we end up adding weight offset to a NULL "weight". This caused a seg fault running on a CPU and cuda error 13 running on GPU.

I hit this in a scenario where I was doing layerwise training of a convolutional autoencoder. The learning rate for the already-trained layers was set to zero, and the newly-added layers had non-zero learning rate.