kyamagu / matlab-lmdb

Matlab LMDB wrapper
Other
38 stars 24 forks source link

loading existing lmdb data into matlab #4

Open swamiviv opened 9 years ago

swamiviv commented 9 years ago

Hi,

I am wondering how to use this package to load existing .mdb files into matlab ? I tried this:

database = lmdb.DB(<path-to-mdb-file>,'RDONLY',true);

but without success:

Error using LMDB_ Not a directory

Error in lmdb.DB (line 65) this.id = LMDB('new', filename, varargin{:});

Could you please clarify this ?

kyamagu commented 9 years ago

@swamiviv The path should be the LMDB directory, not the internal file.

swamiviv commented 9 years ago

@kyamagu Thanks, that was stupid of me! I did that and was able to read the keys and values. The keys are fine but the values I read seem like garbage or in some encrypted form. Do you have any idea why this happens ? I am doing this to read the feature outputs from a trained caffe deep network.

kyamagu commented 9 years ago

@swamiviv They are serialized Datum. You have to write a function to decode the datum. I have a code for uncompressed datum, but if your datum is compressed, you have to modify this.

EDIT: I've updated the sample datum converter.

swamiviv commented 9 years ago

Thanks a lot! It works great!

Linzert commented 9 years ago

Hi, I have the same question with swamiviv,but I don't know where my LMDB is,I just install it by 'sudo apt-get install liblmdb-dev'

swamiviv commented 9 years ago

Hi Linzert,

You can find the installed libraries on linux by using locate, something like 'locate "lmdb" should get you the paths where its installed. But if you did the default inatallation the documentation should specify the default paths.

On Sat, Jun 20, 2015 at 7:59 PM, Linzert notifications@github.com wrote:

Hi, I have the same question with swamiviv,but I don't know where my LMDB is,I just install it by 'sudo apt-get install liblmdb-dev'

— Reply to this email directly or view it on GitHub https://github.com/kyamagu/matlab-lmdb/issues/4#issuecomment-113842706.

--Swami

Linzert commented 9 years ago

@swamiviv Thanks for your reply!Just as you know,caffe should depend on lmdb and we install lmdb by apt-get install on linux,I tried all the path list on 'locate lmdb' but still get the error message "Error using LMDB No such file or directory".What's wrong with it?

kyamagu commented 9 years ago

@Linzert You're very likely specifying the wrong file. Please post your error and how you are using the lmdb API.

Linzert commented 9 years ago

@kyamagu First,thanks for your reply!After downloading the wrapper,I put it in the path $MATLAB-LMDB,unpack it and configure the Makefile.Then I do this in the terminal: cd $MATLAB-LMDB make make test

When it succeeds,I run matlab and in the command window,I input database=lmdb.DB('PATH_TO_LMDB','RDONLY',true),and the error message is:

Error using LMDB No such file or directory Error in lmdb.DB(line 65) this.id=LMDB('new',filename,varargin{:})

What's wrong with it?

kyamagu commented 9 years ago

PATH_TO_LMDB is wrong. You don’t specify your database location correctly.

Pinlong-Zhao commented 8 years ago

I have the same question with swamiviv.I read the values like garbage,too.
but i can't open the link of "the sample datum converter". Can you give it again? And the details what i should do? Thank you very much both you two @kymagu @swamiviv

kyamagu commented 8 years ago

@sliencestorm https://gist.github.com/kyamagu/31a4b6f782670a28098b

Pinlong-Zhao commented 8 years ago

My colleagues and I still can't open the link, do you have other ways to solve this matter, I am looking forward to your reply, thank you @kyamagu

kyamagu commented 8 years ago

@sliencestorm That is very likely a network problem on your side. Make sure you do not have any proxy blocking your access to gist.github.com

Pinlong-Zhao commented 8 years ago

@kyamagu Thank you for your replay. I have asked many friends to open the link.But none of them can open it. So the problem should be the network in China ,making me can't access to gist.github.com. I turned .mdb files into .txt by python just now. I still want to know how to read the .mdb files in matlab. Can you send the code to me by email, 394523651@qq.com ? Thank you,again.

kyamagu commented 8 years ago

@sliencestorm Check the caffe-extension branch.

Pinlong-Zhao commented 8 years ago

@swamiviv I can access to the link, thank you very much. But i still can't understand what i should do .I have added all the additional files. But it can't work, the values is still garbage. Whether it means that i must change the code in the caffe.proto? Then the value will be normal. Sincerely thank you ,again.