caffe icon indicating copy to clipboard operation
caffe copied to clipboard

Check failed: data_ error loading custom leveldb

Open log0 opened this issue 12 years ago • 0 comments

Hi all,

I am trying to run CAFFE on some toy data (later to learn CAFFE to apply on non-image data).

Questions:

  • When I run 'train_net.bin', I received the error: "F0530 03:27:06.673624 1573 blob.cpp:77] Check failed: data_", what does this mean? I checked "data" is not null in the levelDB.
  • Are there any good tutorials on using custom data (and not those pre-generated)?

Here is how I generated the data:

# ~/source/caffe/build/tools/train_net.bin lenet_solver.prototxt
import leveldb
import numpy as np
import caffe.pycaffe as pycaffe

Datum = pycaffe.caffe.proto.caffe_pb2.Datum

X = np.array([ \
    [0,0,0], \
    [0,0,1], \
    [0,1,0], \
    [0,1,1], \
    [1,0,0], \
    [1,0,1], \
    [1,1,0], \
    [1,1,1], \
])

Y = np.array([0,1,0,1,0,1,0,1])

data = []
for i in xrange(X.shape[0]):
    datum = Datum()
    datum.width = 3
    datum.height = 1
    datum.data = ''.join([str(i) for i in X[i]])
    datum.label = Y[i]
    data.append(datum.SerializeToString())

train_db = leveldb.LevelDB('./my-train')
train_db.Put('0', data[0])
train_db.Put('1', data[1])
train_db.Put('2', data[2])
train_db.Put('3', data[3])
train_db.Put('4', data[4])
train_db.Put('5', data[5])

test_db = leveldb.LevelDB('./my-test')
test_db.Put('6', data[6])
test_db.Put('7', data[7])

For the 'lenet_solver.prototxt', they are basically all copied from the LENET example except pointing to my own database.

Appreciate the help!

log0 avatar May 30 '14 03:05 log0