willyd / caffe-builder

CMake build scripts to automate building the Caffe library and its dependencies.
BSD 2-Clause "Simplified" License
186 stars 116 forks source link

Opening LMBD in convert_imageset check failed: mdb_status == 0 (112 vs. 0)  #16

Closed pkrush closed 8 years ago

pkrush commented 9 years ago

Hi,

Has any one used convert_imageset with caffe-builder?

I want to create LMBD databases on Windows in C++.

I started out playing with convert_imageset and I can't seem to get it to work no matter what I do.

I am trying to use convert_imageset.cpp

db_lmdb.cpp fails at this line:

MDB_CHECK(mdb_env_open(mdbenv, source.c_str(), flags, 0664));

F1003 08:49:07.526494 10752 db_lmdb.hpp:13] Check failed: mdb_status == 0 (112 vs. 0) 

I don't know if this is a Windows issue or I am calling it wrong. It gets as far as creating the directory, the data.mdb and lock.mdb. When it goes to open the LMDB it fails.

willyd commented 9 years ago

Hi @pkrush, as stated in the README of this project the LMDB interface is not working.

Some discussion as been going on about this in this caffe PR.

Also, I just merged a PR by @happynear in my LMDB fork so you might just try to rebuild LMDB. To do so, either go to the download cache lmdb folder and enter:

git pull

or delete the lmdb folder and configure caffe-builder again.

After that build caffe-builder as usual and you should be good to go.

Let me know if this works.

pkrush commented 9 years ago

Thanks so much for pointing this out and thanks as well for caffe-builder in general.

Both methods did not work for me. They had the same result as before.

After seeing this post...

It did work fine after lowering LMDB_MAP_SIZE in db_lmdb.cpp const size_t LMDB_MAP_SIZE = 1099511627776; // 1 TB

happynear commented 9 years ago

This patch is only valid on NTFS disk. It will create a file with size of 1TB, but occupies only a few disk space. The size of the db file will be truncated to its real size after all data is written done.

pkrush commented 9 years ago

My disks are NTFS, on Windows 10. I made a copy before I did the get pull and liblmdb/mdb.c was updated.

BTW, this is not a big issue to me, I am going to work around it. I am just following up. Also this is a bit over my head. I am just learning as I go here.

Thanks!