the LMDB creating tool /caffe/build/tools/convert_imageset can’t handle datasets with channel greater than 4, when creating LMDB file from multi-channel, we can use lmdb module in python.
import caffe import numpy as np import lmdb mydb = lmdb.open('/path/to/your/lmdb', map_size=int(1e12)) db_txn = mydb.begin(write=True) index = 0 im_data = np.zeros([6, 227, 227]) label = 0 in_dat = caffe.io.array_to_datum(im_data, label) in_datss = in_dat.SerializeToString() db_txn.put('{:0>10d}'.format(index), in_datss) index = index + 1 db_txn.commit() mydb.close()