caffe icon indicating copy to clipboard operation
caffe copied to clipboard

Need documentation about caffe data format

Open jrabary opened this issue 12 years ago • 8 comments

Hi all,

Where can I find some documentation about the data format that caffe use. I need to translate our data into caffe compatible format (leveled) but just don't know how to do this.

Best regards,

Jaonary

jrabary avatar Jun 30 '14 08:06 jrabary

I think it's just this http://code.google.com/p/leveldb/ There is also a tool included in caffe that takes a directory with images and a file containing the names of the images and a class and create a leveldb for you. It's named "convert_imageset"

marc40000 avatar Jun 30 '14 10:06 marc40000

As far as I know, leveldb is a key/value database. What should I use for the key and the value ?

jrabary avatar Jun 30 '14 11:06 jrabary

Have a look at tools/convert_imageset.cpp . Line 88 to 95 prepares the key and value and puts it in the db. The key looks like the line number of the Image in the list file and appended filename, formated like this: "%08d_%s". The value is an Instanze of Datum serialized, which basically holds the Image and the class.

marc40000 avatar Jun 30 '14 11:06 marc40000

Ok thank you. This was I understood but I just wonder why caffe uses a key/value store since the value is the pair (data,label).

jrabary avatar Jun 30 '14 13:06 jrabary

Glad someone asked this. I'd appreciate it if there was a small description of this somewhere more efficient than reading a script.

GregAtHeron avatar Jul 01 '14 18:07 GregAtHeron

There is now a data section of the tutorial documentation and the layer catalogue. If the description is lacking then please PR further details you find helpful.

shelhamer avatar Sep 21 '14 22:09 shelhamer

I still don't get the point, as the documents still describe nothing about the data structure. Can anyone writes like this: (with the correct format, of course)

key: data sequence number value: label string followed by '\0' then data

or something? I want to convert non-image (PCM) byte arrays into leveldb.

urakagi avatar Sep 18 '15 07:09 urakagi

@shelhamer I tried to generate the leveldb files from CIFAR-10 binary data using create_cifar10.sh with DBTYPE=leveldb. But, I got four empty files (lock, log, and log.old, MANIFEST) and no .sst files in both training and testing data folder. There was no error generated while execution.

ronakgupta avatar Jun 24 '16 19:06 ronakgupta