I'm using the backward function of pycaffe to realize the deconvolution process. I first run the forward process and get the output data blob of the net, then assign the data blob to the diff blob of the top layer, then run the backward process. However, the diffs of bottom layers are not changed by the backward process, which are all zeros. I don't know why the diff is not transferred by backward.
def backward(fcn_net, im, name_list_, target_blob):
start=name_list_[len(name_list_)-1]; end=name_list_[0]
print(start, end)
fcn_net.blobs[start].diff[...]=im[...]
fcn_net.backward(start=start, end=end)
return fcn_net.blobs[target_blob].diff
In the code above the name_list_ contains all conv layers and pooling layers orderly, and the backward starts from the last conv layer. Thanks!