Problems with MDB in the mnist example
When I tried to do the dataset praparation in Mnist example and execute " ./examples/mnist/create_mnist.sh ", it turns out some failures like this:
Creating lmdb... F1016 14:22:01.290793 9722 convert_mnist_data.cpp:132] Check failed: mdb_put(mdb_txn, mdb_dbi, &mdb_key, &mdb_data, 0) == 0 (-30792 vs. 0) mdb_put failed *** Check failure stack trace: *** Aborted (core dumped) F1016 14:22:01.431432 9724 convert_mnist_data.cpp:132] Check failed: mdb_put(mdb_txn, mdb_dbi, &mdb_key, &mdb_data, 0) == 0 (-30792 vs. 0) mdb_put failed *** Check failure stack trace: *** Aborted (core dumped) Done.
How can I fix this problem? thanks
@moegitree I just tried the mnist example and it works, could you pull again. Make sure you do make clean, delete the db in ./examples/mnist/` and try again
@sguada I am having the same problem. If you make clean, there will be no build folder that is referenced by the create_mnist script.
Then you have to make again.
Sergio
2014-10-22 16:51 GMT-07:00 Scott Little [email protected]:
@sguada https://github.com/sguada I am having the same problem. If you make clean, there will be no build folder that is referenced by the create_mnist script.
— Reply to this email directly or view it on GitHub https://github.com/BVLC/caffe/issues/1298#issuecomment-60174029.
@moegitree How much free disk space do you have? I read that mdb_put errors happen when there isn't enough space. I have 100 GB of free space. According to the MNIST website, there should be around 10 MB of data.
@moegitree I have also experience some errors with LMDB when using conver_imageset. @kmatzen could you take a look at this error?
Same issue
/** Environment mapsize reached */
#define MDB_MAP_FULL (-30792)
mapsize is set to 1TB. It might be worthwhile inspecting the resulting mapsize after the environment has been opened.
You could try the following after the call to mdb_env_open to make sure it's equal to 1099511627776. If not, then mdb_env_set_mapsize is returning MDB_SUCCESS without actually updating the map size.
MDB_envinfo envinfo;
CHECK_EQ(MDB_SUCCESS, mdb_env_info(mdb_env, &envinfo));
LOG(INFO) << "MAPSIZE " << envinfo.me_mapsize;
I can't reproduce the bug. Can you send instructions?
I changed mapsize to 1073741824 (1GB) and it works now.
CHECK_EQ(mdb_env_set_mapsize(mdb_env, 1073741824), MDB_SUCCESS) // 1GB
<< "mdb_env_set_mapsize failed";
It seems that 1TB is too huge. I'm running 32-bit Ubuntu, maybe that's the cause.
That's probably the case since mdb_env_set_mapsize takes a size_t. But didn't your compiler report something like warning: integer constant is too large for its type?
Yes, it did report, but I didn't notice that.
I have same problem, I am using it for training imageNet, 1GB seems too small for ImageNet. My free disk is 1.1TB, I also tried 300GB, 500GB, all failed. I have no idea.
Hi, @moegitree I have same problem, have you fix your problem?
I am also using Ubuntu 32 bit and got this error. Changing the 1099511627776 to 1073741824 in examples/mnist/convert_mnist_data.cpp fixed it.
Can we add a compile flag for this? It seems to be a common issue (I just had to come here to fix it).
Same issue fixed with your modification of the mnist script on my Ubuntu 32 bits, 14.04 ;
I have the exact same error and tried the same fix by chaning value to 1gb, but the error is still there and exactly the same. What can be the problem?
Exact output:
`Creating lmdb...
F0407 08:02:22.195675 24302 convert_mnist_data.cpp:138] Check failed: mdb_put(mdb_txn, mdb_dbi, &mdb_key, &mdb_data, 0) == 0 (-30792 vs. 0) mdb_put failed
*** Check failure stack trace: ***
@ 0xb69ae060 (unknown)
@ 0xb69adf5c (unknown)
@ 0xb69adb78 (unknown)
@ 0xb69aff98 (unknown)
@ 0xa656 convert_dataset()
@ 0x9e80 main
@ 0xb6706632 (unknown)
Aborted
F0407 08:02:22.427784 24305 convert_mnist_data.cpp:138] Check failed: mdb_put(mdb_txn, mdb_dbi, &mdb_key, &mdb_data, 0) == 0 (-30792 vs. 0) mdb_put failed
*** Check failure stack trace: ***
@ 0xb69a6060 (unknown)
@ 0xb69a5f5c (unknown)
@ 0xb69a5b78 (unknown)
@ 0xb69a7f98 (unknown)
@ 0xa656 convert_dataset()
@ 0x9e80 main
@ 0xb66fe632 (unknown)
Aborted `
Made Caffe again and now it works.
My fix at https://github.com/BVLC/caffe/pull/3731 may help avoid these problems in the future.