map_size = Y.nbytes*10
env = lmdb.open(saveloc+'labels', map_size=map_size)
for z in N:
i = N[z]
im_dat = caffe.io.array_to_datum(np.array(Y[i]).astype(np.uint8))
str_id = '{:0>10d}'.format(i)
with env.begin(write=True) as txn:
txn.put(str_id, im_dat.SerializeToString())
But when I load the label in the net, the label is shown to be float32.
model='train.prototxt'
net = caffe.Net(model,caffe.TEST)
net.forward()
label=net.blobs['label'].data
label.dtype
displays: dtype('float32'). Anybody knows why? My segmentation result is not as good when I converted my jpg data and label to LMDB. Could it be because my label is loaded as float?
I used the same method as you. And I also met this problem. I met an error : Check failed: status == CUBLAS_STATUS_SUCCESS (11 vs. 0) CUBLAS_STATUS_MAPPING_ERROR
Have you solved your problem?
I have converted my label to LMDB:
Defined them inside train.prototxt:
But when I load the label in the net, the label is shown to be float32.
displays:
dtype('float32')
. Anybody knows why? My segmentation result is not as good when I converted my jpg data and label to LMDB. Could it be because my label is loaded as float?