Error in building mean image file

153 views
Skip to first unread message

Kevin George

unread,
Dec 19, 2016, 2:22:41 AM12/19/16
to Caffe Users
I am trying to do classification of digits(mnist). I need to make an mean image file from the lmdb data to use it for testing(classification) on an image of a digit.
So I am trying to use the compute_image_mean to build the mean image file but I am getting the following error below.

F1219 12:45:42.852679  6189 db_lmdb.hpp:15] Check failed: mdb_status == 0 (20 vs. 0) Not a directory
*** Check failure stack trace: ***
    @     0x7f4c092bbdaa  (unknown)
    @     0x7f4c092bbce4  (unknown)
    @     0x7f4c092bb6e6  (unknown)
    @     0x7f4c092be687  (unknown)
    @     0x7f4c097a1291  caffe::db::LMDB::Open()
    @           0x402044  main
    @     0x7f4c082c7f45  (unknown)
    @           0x402a8a  (unknown)
    @              (nil)  (unknown)
Aborted (core dumped)

Command used- ./../build/tools/compute_image_mean ./data/train.mdb ./mean.binaryproto 

Is this the correct way to generate a mean image file?

Przemek D

unread,
Dec 19, 2016, 3:48:30 AM12/19/16
to Caffe Users
No, it is not. Just as the error tells you: the path you passed is not a directory. You are supposed to pass a directory path to your database, not the .mdb file. Instead try:
./../build/tools/compute_image_mean ./data ./mean.binaryproto

Kevin George

unread,
Dec 19, 2016, 4:11:54 AM12/19/16
to Caffe Users
Hi Przemek, even when I passed a path to the directory of database, I am getting the same error.
Output-
F1219 14:36:29.030217  9297 db_lmdb.hpp:15] Check failed: mdb_status == 0 (2 vs. 0) No such file or directory
*** Check failure stack trace: ***
    @     0x7fc65ddc4daa  (unknown)
    @     0x7fc65ddc4ce4  (unknown)
    @     0x7fc65ddc46e6  (unknown)
    @     0x7fc65ddc7687  (unknown)
    @     0x7fc65e2aa291  caffe::db::LMDB::Open()
    @           0x402044  main
    @     0x7fc65cdd0f45  (unknown)
    @           0x402a8a  (unknown)
    @              (nil)  (unknown)
Aborted (core dumped)


Przemek D

unread,
Dec 19, 2016, 4:25:24 AM12/19/16
to Caffe Users
Check your paths then, make sure you're passing the right one (ie. it really points to an LMDB database).
Also, why do you type:
./(...)/compute_image_mean (...) ./mean.binaryproto
I specifically mean the ./ before mean.binaryproto. In my (limited) understanding of unix systems, this is used to precede commands, not file paths. Did you mean ../? Perhaps you should not use it at all?

Kevin George

unread,
Dec 19, 2016, 4:52:08 AM12/19/16
to Caffe Users
I have made a folder 'project' and I am in that folder.I used a script with the absolute file paths but still the error occurs. I have attached the script. The binaryproto file will get automatically generated if there is no error right?
make_mnist_mean.sh

Shai Bagon

unread,
Dec 20, 2016, 1:35:04 AM12/20/16
to Caffe Users
It seems like the image lmdb file was corrupted. See [this stackoverflow thread ](http://stackoverflow.com/questions/41217663/error-in-building-mean-image-filecaffe#comment69649076_41221965) for more details.

Kevin George

unread,
Dec 20, 2016, 2:45:51 AM12/20/16
to Caffe Users
Thanks Shai. Sorry, I totally forgot to update on this group.
Reply all
Reply to author
Forward
0 new messages