Caffe: Check failed: mdb_status == 0 (2 vs. 0) No such file or directory

Created on 17 Jul 2015  ·  15Comments  ·  Source: BVLC/caffe

Upon running ./train_caffenet.sh; creating the training layer data, setting up the data, loading the training mean.binaryproto file and opening the training lmdb all works.

However when it comes to loading the test mean.binaryproto file for the test data I get the following error:

Loading mean file from: /home/pwhc/caffe/Learn/imagenet_mean_test.binaryproto
F0716 13:12:13.917732 3385 db.hpp:109] Check failed: mdb_status == 0 (2 vs. 0) No such file or directory
* Check failure stack trace: *
@ 0x7f8337946daa (unknown)
@ 0x7f8337946ce4 (unknown)
@ 0x7f83379466e6 (unknown)
@ 0x7f8337949687 (unknown)
@ 0x7f8337cbf5be caffe::db::LMDB::Open()
@ 0x7f8337d16b82 caffe::DataLayer<>::DataLayerSetUp()
@ 0x7f8337d806f9 caffe::BasePrefetchingDataLayer<>::LayerSetUp()
@ 0x7f8337ca3db3 caffe::Net<>::Init()
@ 0x7f8337ca5b22 caffe::Net<>::Net()
@ 0x7f8337cb0a24 caffe::Solver<>::InitTestNets()
@ 0x7f8337cb111b caffe::Solver<>::Init()
@ 0x7f8337cb12e6 caffe::Solver<>::Solver()
@ 0x40c4c0 caffe::GetSolver<>()
@ 0x406503 train()
@ 0x404ab1 main
@ 0x7f8336e58ec5 (unknown)
@ 0x40505d (unknown)
@ (nil) (unknown)
Aborted (core dumped)

I modified the train_val.prototxt to point to the appropriate mean.binaryproto files (using absolute paths) and have checked and double checked to make sure the paths match up

Any thoughts would be greatly appreciated!

Most helpful comment

I have the same problem. Then I notice the path to the LMDB is relative path, and the system can't find it.

All 15 comments

@p4tr1ckc4rs0n, I am also suffering from the same problem....anyone please advise..

data_param.source should point to an LMDB (see here).
transform_param.mean_file should point to a .binaryproto file (see here).

It sounds like you've put in the path to a .binaryproto where you need the path to an LMDB.

@lukeyeager the only other thing i changed in the train_val.prototxt was the num_output: 2 since i only want a 0/1 classification.

Data layers for caffe model:

name: "CaffeNet"
layer {
name: "data"
type: "Data"
top: "data"
top: "label"
include {
phase: TRAIN
}
transform_param {
mirror: true
crop_size: 227
mean_file: "../imagenet_mean_train.binaryproto"
}

data_param {
source: "/home/pwhc/caffe/GPRLearn/lmdb/GPR_train_lmdb"
batch_size: 1
backend: LMDB
}
}
layer {
name: "data"
type: "Data"
top: "data"
top: "label"
include {
phase: TEST
}
transform_param {
mirror: false
crop_size: 227
mean_file: "../imagenet_mean_test.binaryproto"
}

data_param {
source: "/home/pwhc/caffe/GPRLearn/GPR_test_lmdb"
batch_size: 1
backend: LMDB
}
}

This is my solver.prototxt file

net: "/home/pwhc/caffe/GPRLearn/Models/train_val.prototxt"
test_iter: 10
test_interval: 50
base_lr: 0.01
lr_policy: "step"
gamma: 0.1
stepsize: 500
display: 20
max_iter: 4500
momentum: 0.9
weight_decay: 0.0005
snapshot: 1000
snapshot_prefix: "/home/pwhc/caffe/GPRLearn/caffenet_train"
solver_mode: CPU

Ok I guess the log message was just confusing me. Nevermind.

Can you check that data.mdb exists in that directory:

$ ls /home/pwhc/caffe/GPRLearn/lmdb/GPR_train_lmdb/
data.mdb lock.mdb

Closing as this looks like a usage issue; it's very likely that a path to one of your LMDBs is not correct (e.g., are your train and test LMDBs really in different directories?).

Please ask usage questions on caffe-users. If you do think there is a bug in Caffe, you're welcome to open a new issue according to https://github.com/BVLC/caffe/wiki/Reporting-Bugs-and-Other-Issues. Thanks!

Dear @longjon
I am running a caffe PR for fully-convolutional semantic segmentation made available by you (https://github.com/longjon/caffe/tree/future). I am stuck with this very problem while trying to read the lmdb files for the ground truth labels, though the lmdb for the images is being read successfully. I have double-checked to make it sure that the lmdb paths are correct. I am using this python script #1698 to create my lmdb files both for images and their ground-truth labels on pascal voc dataset.

I would highly appreciate if you kindly respond.

I had the same error but then I realised that I did not have access to the lmdb folder (try cd into the lmdb folder). By changing permissions I got rid of the error

@lukeyeager My cifar10_full_train_test.prototxt :
name: "CIFAR10_full"
layer {
name: "cifar"
type: "Data"
top: "data"
top: "label"
include {
phase: TRAIN
}
transform_param {
mean_file: "examples/cifar10/mean.binaryproto"
}
data_param {
source: "examples/cifar10/cifar10_train_lmdb"
batch_size: 100
backend: LMDB
}
}
But I do not find _cifar10_train_lmdb_ and _mean.binaryproto_ in the cifar10 file. I happen the same problem:
Check failed: mdb_status == 0 (2 vs. 0) No such file or directory

I have the same problem. Then I notice the path to the LMDB is relative path, and the system can't find it.

@wakemeupJ what do you mean it's a relative path? I use the absolute path, but it still gives the same error
Check failed: datum_channels > 0 (0 vs. 0). Could you give me some help? thanks.

I solved this issue by changing normal user to root, $ to # in command prompt.

try to convert data into lmdb

it turns out to be that lmdb file path should be absolute path or execute the scripts in caffe root.

check your path name in make_imagenet_mean.sh , there might be typing error .

I found a solution to this. Kindly read the readme.md file in directory of the train and test data e.g. cifar10. But firstly, caffe must be compiled successfully because a build file will be generated after a successful compilation which will be used as a path when running the command specified in the readme file.

Was this page helpful?
0 / 5 - 0 ratings