I want to generate out of 'upsocre' layer of Caffenet(output class=9, there for the size of 'upscore' layer is 9). However, all pixels of upscore layer tuned 0 after using argmax(axis=0). any idea pleas?
(upscore is deconvolution layer )
layer {
name: "upscore"
type: "Deconvolution"
bottom: "score_fr"
top: "upscore"
param {
lr_mult: 0.0
}
convolution_param {
num_output: 9
weight_filler: { type: "bilinear" }
bias_term: false
kernel_size: 25
stride: 1
}
}
$
in_ = mh.hypermat('../data/pavia/PaviaU.mat','../data/pavia/PaviaU_gt.mat').load_image()
in_ = in_[:,:,::-1]
in_ = in_.transpose((2,0,1))
print(in_.shape) # 103, 610, 340
# init
caffe.set_device(0)
caffe.set_mode_gpu()
# load net
net = caffe.Net('deploy.prototxt', 'snapshot/train_iter_5000.caffemodel', caffe.TEST)
net.blobs['data'].reshape(1, 103, 610, 340)
#net.blobs['data'].data[...] = in_
# run net and take argmax for prediction
output = net.forward(data=np.asarray([in_]))
output_prob1 = output['upscore'][0]
output_prob2 = output['upscore'][0].squeeze().argmax(axis=0)
print(output_prob1.shape)
print(output_prob1)
print(output_prob2.shape)
print(output_prob2)