Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mdb_txn_commit failed #97

Closed
PkuRainBow opened this issue Dec 4, 2017 · 3 comments
Closed

mdb_txn_commit failed #97

PkuRainBow opened this issue Dec 4, 2017 · 3 comments
Assignees

Comments

@PkuRainBow
Copy link

PkuRainBow commented Dec 4, 2017

Hi, I have build the project successfully and want to generate the lmdb file using the convert_imageset_and_flow.cpp project.
But I have tried for multiple times and meet the exactly the same error:
wechat image_20171204101027

The error is located at(line #458 convert_imageset_and_flow.cpp) 👍

if (++count % 100 == 0) {
  // Commit txn
  if (db_backend == "leveldb") {  // leveldb
    db->Write(leveldb::WriteOptions(), batch);
    delete batch;
    batch = new leveldb::WriteBatch();
  } else if (db_backend == "lmdb") {  // lmdb
      CHECK_EQ(mdb_txn_commit(mdb_txn), MDB_SUCCESS)
        << "mdb_txn_commit failed";
    CHECK_EQ(mdb_txn_begin(mdb_env, NULL, 0, &mdb_txn), MDB_SUCCESS)
        << "mdb_txn_begin failed";
  } else {
    LOG(FATAL) << "Unknown db backend " << db_backend;
  }
  LOG(ERROR) << "Processed " << count << " files.";

I have tried to increase the initial database size like this,

  // Open db
  //...
  } else if (db_backend == "lmdb") {  // lmdb
    LOG(INFO) << "Opening lmdb " << argv[arg_offset+2];
    CHECK_EQ(mkdir(argv[arg_offset+2], 0744), 0)
        << "mkdir " << argv[arg_offset+2] << "failed";
    CHECK_EQ(mdb_env_create(&mdb_env), MDB_SUCCESS) << "mdb_env_create failed";
    CHECK_EQ(mdb_env_set_mapsize(mdb_env, 109951162777600), MDB_SUCCESS)  // increase the size
        << "mdb_env_set_mapsize failed";
    CHECK_EQ(mdb_env_open(mdb_env, argv[arg_offset+2], 0, 0664), MDB_SUCCESS)
    //...

But I still the same error. Could anyone help me?

@PkuRainBow
Copy link
Author

@nikolausmayer

@nikolausmayer
Copy link
Contributor

Hi,

does the description in this thread match your problem case? https://groups.google.com/d/msg/caffe-users/GFaBKPeUvbw/Gf8mKra2BQAJ

You already tried a larger initial size. Could you also try a smaller transaction size? Perhaps % 10 instead of % 100 in if (++count % 100 == 0).

I don't have LMDB experience and probably cannot be of much help here.

@nikolausmayer
Copy link
Contributor

(closed due to inactivity)

@nikolausmayer nikolausmayer self-assigned this May 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants