用Caffe自制训练数据库报错
在根据自己的博客做实验的时候,遇到了如下报错:
yang@yang-Pre:~/git/caffe$ ./examples/myself/create_myimagenet.sh
Creating train lmdb...
I0407 11:21:07.063206 8421 convert_imageset.cpp:86] Shuffling data
I0407 11:21:07.537595 8421 convert_imageset.cpp:89] A total of 201 images.
I0407 11:21:07.537858 8421 db_lmdb.cpp:35] Opened lmdb /home/yang/git/caffe/examples/myself/myself_train_lmdb
E0407 11:21:07.621695 8421 io.cpp:80] Could not open or find file /home/yang/git/caffe/data/myself/train/I0407 11:21:08.045325 8421 convert_imageset.cpp:153] Processed 200 files.
Creating val lmdb...
I0407 11:21:08.267316 8458 convert_imageset.cpp:86] Shuffling data
I0407 11:21:08.712527 8458 convert_imageset.cpp:89] A total of 61 images.
I0407 11:21:08.712815 8458 db_lmdb.cpp:35] Opened lmdb /home/yang/git/caffe/examples/myself/myself_val_lmdb
E0407 11:21:08.763945 8458 io.cpp:80] Could not open or find file /home/yang/git/caffe/data/myself/val/
I0407 11:21:08.885560 8458 convert_imageset.cpp:153]Processed 60 files.
Done.
搞了半天不知道问题出在哪里,自己摸索了好才发现是我的train.txt,val.txt,test.txt文件都多打了一行,如下图所示。
解决办法:应该把最后一行去掉,有多少张图片,.txt文件中就应该有多少行。
(如果此方法不能解决大家的问题,请联系我。如果成功解决记得点赞哦~~)