Skip to content
This repository has been archived by the owner on Feb 4, 2020. It is now read-only.

loading existing lmdb data into matlab #4

Open
swamiviv opened this issue Jun 18, 2015 · 17 comments
Open

loading existing lmdb data into matlab #4

swamiviv opened this issue Jun 18, 2015 · 17 comments

Comments

@swamiviv
Copy link

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
Copy link
Owner

kyamagu commented Jun 18, 2015

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

@swamiviv
Copy link
Author

@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
Copy link
Owner

kyamagu commented Jun 18, 2015

@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
Copy link
Author

Thanks a lot! It works great!

@Linzert
Copy link

Linzert commented Jun 20, 2015

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
Copy link
Author

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 [email protected] 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
#4 (comment).

--Swami

@Linzert
Copy link

Linzert commented Jun 21, 2015

@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
Copy link
Owner

kyamagu commented Jun 22, 2015

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

@Linzert
Copy link

Linzert commented Jun 23, 2015

@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
Copy link
Owner

kyamagu commented Jun 23, 2015

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

@Pinlong-Zhao
Copy link

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
Copy link
Owner

kyamagu commented Mar 28, 2016

@Pinlong-Zhao
Copy link

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
Copy link
Owner

kyamagu commented Mar 29, 2016

@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
Copy link

@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, [email protected] ? Thank you,again.

@kyamagu
Copy link
Owner

kyamagu commented Mar 30, 2016

@sliencestorm Check the caffe-extension branch.

@Pinlong-Zhao
Copy link

@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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants