Check failed: image_file Unable to open file data/mnist/train-images-idx3-ubyte

装好了caffe,想跑一个mnist的数据集,但是在转换成LMDB时出现问题,问题如下:

python@ubuntu:~/caffe$ sudo sh examples/mnist/create_mnist.sh 
Creating lmdb...
F0422 22:45:35.072829 84051 convert_mnist_data.cpp:48] Check failed: image_file Unable to open file data/mnist/train-images-idx3-ubyte
*** Check failure stack trace: ***
    @     0x7fc92ad135cd  google::LogMessage::Fail()
    @     0x7fc92ad15433  google::LogMessage::SendToLog()
    @     0x7fc92ad1315b  google::LogMessage::Flush()
    @     0x7fc92ad15e1e  google::LogMessageFatal::~LogMessageFatal()
    @           0x40328a  convert_dataset()
    @           0x40228a  main
    @     0x7fc929e87830  __libc_start_main
    @           0x4022d9  _start
    @              (nil)  (unknown)
Aborted (core dumped)

怎么回事呢?

笔者顺着指令打开了examples/mnist下的create_mnist.sh文件:原来是名字不一样导致的:

create_mnist.sh里写的是:Check failed: image_file Unable to open file data/mnist/train-images-idx3-ubyte_第1张图片

而实际我们的文件为:

Check failed: image_file Unable to open file data/mnist/train-images-idx3-ubyte_第2张图片

我们按照create_mnist.sh里的文件命名将数据集里的.(点号)改成-(短线),如下:

Check failed: image_file Unable to open file data/mnist/train-images-idx3-ubyte_第3张图片

再次输入命令:sudo sh examples/mnist/create_mnist.sh 

Check failed: image_file Unable to open file data/mnist/train-images-idx3-ubyte_第4张图片

成功啦,caffe真的是一步一个坑。
 

你可能感兴趣的:(Check failed: image_file Unable to open file data/mnist/train-images-idx3-ubyte)