Can `No such file or directory` only mean that the

2019-02-26 05:15发布

问题:

I am trying to train a network using caffe, but am getting a file-not-found exception:

I0111 11:19:27.339706  5151 layer_factory.hpp:76] Creating layer data
I0111 11:19:27.340117  5151 net.cpp:106] Creating Layer data
I0111 11:19:27.340126  5151 net.cpp:411] data -> data
I0111 11:19:27.340154  5151 net.cpp:411] data -> label
I0111 11:19:27.340165  5151 data_transformer.cpp:25] Loading mean file from: /home/myUser/Documents/code/RFNN/data/ILSVRC2012/10class/imagenet_mean_10biggest.binaryproto
F0111 11:19:27.340873  5157 db_lmdb.hpp:14] Check failed: mdb_status == 0 (2 vs. 0) No such file or directory
*** Check failure stack trace: ***
    @     0x7f7f1c8f35cd  google::LogMessage::Fail()
    @     0x7f7f1c8f5433  google::LogMessage::SendToLog()
    @     0x7f7f1c8f315b  google::LogMessage::Flush()
    @     0x7f7f1c8f5e1e  google::LogMessageFatal::~LogMessageFatal()
    @     0x7f7f1d032532  caffe::db::LMDB::Open()
    @     0x7f7f1cfe9966  caffe::DataReader::Body::InternalThreadEntry()
    @     0x7f7f1cfdfc25  caffe::InternalThread::entry()
    @     0x7f7f127285d5  (unknown)
    @     0x7f7f11fd66ba  start_thread
    @     0x7f7f1be6c82d  clone
    @              (nil)  (unknown)
Aborted (core dumped)

There could be all kinds of things causing errors, but this specific file does seem to be there. I already changed the path to the absolute path, checked spelling (there is indeed a file with this exact name in this exact folder) and double checked the permissions of the file to be read-write.
The difficulty is finding the cause of this error when the file does seem to be there. I mean, what else could be the cause?
So my question is: does anyone know what could be the cause of this error?

edit: on request, the output of ls -ltrh /home/myUser/Documents/code/RFNN/data/ILSVRC2012/10class/imagenet_mean_10biggest.binaryproto:

-rwxrwxr-x 1 myUser myUser 769K jan 10 16:39 /home/myUser/Documents/code/RFNN/data/ILSVRC2012/10class/imagenet_mean_10biggest.binaryproto

I'm assuming the relevant part of the prototxt file is:

name: "rfnn_ILSVRC2012_Small"
layer {
top: "data"
top: "label"
name: "data"
type: "Data"
data_param {
source: "/home/myUser/Documents/code/RFNN/data/ILSVRC2012/10class/ilsvrc12_train_lmdb_10biggest"
backend: LMDB
batch_size: 32
}
transform_param {
crop_size: 224
mirror: true
mean_file: "/home/myUser/Documents/code/RFNN/data/ILSVRC2012/10class

/imagenet_mean_10biggest.binaryproto"
  }
  include: { phase: TRAIN }
}
layer {
  top: "data"
  top: "label"
  name: "data"
  type: "Data"
  data_param {
    source: "/home/myUser/Documents/code/RFNN/data/ILSVRC2012/10class/ilsvrc12_val_lmdb_10biggest"
    backend: LMDB
    batch_size: 32
  }
  transform_param {
    crop_size: 224
    mirror: false
    mean_file: "/home/myUser/Documents/code/RFNN/data/ILSVRC2012/10class/imagenet_mean_10biggest.binaryproto"
  }
  include: { phase: TEST }
}

回答1:

Your mean file is indeed in place, but this is not what caffe is complaining about.
What about your database file, '/home/myUser/Documents/code/RFNN/data/ILSVRC2012/10class/ilsvrc12_train_lmdb_10biggest'? is it in the right location?


TL;DR

Can No such file or directory only mean that there is No such file or directory?

Yes.