net = caffe.Net(MODEL_FILE,PRETRAINED)
net.set_mode_cpu()
data4D = np.zeros([max_value,1,96,96])
data4DL = np.zeros([max_value,1,1,1])
data4D[0:max_value,:] = X[200:300,:,:,:]
BATCH_SIZE = 100
net.set_input_arrays(data4D.astype(np.float32),data4DL.astype(np.float32))
net.forward()
ip1 = net.blobs['ip1'].data
print 'Data', ip1.reshape(-1,30)
print 'Shape', ip1.shape
[[ 65.78652191 37.53079605 30.35254669 ..., 75.85479736 48.45568085
78.75233459]
[ 65.78652191 37.53079605 30.35254669 ..., 75.85479736 48.45568085
78.75233459]
[ 65.78652191 37.53079605 30.35254669 ..., 75.85479736 48.45568085
78.75233459]
...,
[ 65.78652191 37.53079605 30.35254669 ..., 75.85479736 48.45568085
78.75233459]
[ 65.78652191 37.53079605 30.35254669 ..., 75.85479736 48.45568085
78.75233459]
[ 65.78652191 37.53079605 30.35254669 ..., 75.85479736 48.45568085
78.75233459]]
net.blobs['ip1'].data is only 0s
net.blobs['ip2'].data is the same result no matter what the input
name: "FKPred"
layers {
name: "data"
type: MEMORY_DATA
top: "data"
top: "label"
memory_data_param {
batch_size: 64 #batch size, so how many prediction youu want to do at once. Best is "1", but higher number get better performance
channels: 1
height: 96
width: 96 #number of input
}
}
layers {
name: "ip1"
type: INNER_PRODUCT
bottom: "data"
top: "ip1"
inner_product_param {
num_output: 100
}
}
layers {
name: "ip2"
type: INNER_PRODUCT
bottom: "ip1"
top: "ip2"
inner_product_param {
num_output: 30
}
}
I think this problem may due to the weight initialization schema, can try xavier .
maybe as said there are some problems with the hdf5 data.
Here is the steps of my preprocessing, before saving the image data into the hdf5, I normalize the image by dividing the 255, also normailise for the [x, y] label data to the range [-1,1]. My base training rate is 0.0001. At the first beginning of training, the test and train loss is very low, below 0.1, would be so abnormal ? I wonder the reason caused it would be because of my labeled data are ranged between [-1,1]?
After the iteration of 5000, the result for different image is different however after iteration 10000, no matter what the image is, the result is the same again.
1) reducing learing rate
2) changing net topology (adding RELUs etc)
3) changing parameter initialization ("xavier" on dev seems especially stabilizing)
still the same problem.
Hey have some of you solve the problem and could share the solution?