guide to use caffe convert_imageset.cpp and making lmdb -
i new caffe , appreciate if guide me. going make lmdb jpg using convert_imagenet.cpp, cannot succeeded. content of create.sh follows:
#!/usr/bin/env sh # create caltech101 lmdb inputs # n.b. set path caltech101 train + val data dirs example=examples/caltech101 data=data/caltech101 tools=build/tools train_data_root=examples/caltech101/caltech101_train/ val_data_root=examples/caltech101/caltech101_train/ # set resize=true resize images 256x256. leave false if images have # been resized using tool. resize=true if $resize; resize_height=256 resize_width=256 else resize_height=0 resize_width=0 fi if [ ! -d "$train_data_root" ]; echo "error: train_data_root not path directory: $train_data_root" echo "set train_data_root variable in create_caltech101.sh path" \ "where caltech101 training data stored." exit 1 fi if [ ! -d "$val_data_root" ]; echo "error: val_data_root not path directory: $val_data_root" echo "set val_data_root variable in create_caltech101.sh path" \ "where caltech101 validation data stored." exit 1 fi echo "creating train lmdb..." glog_logtostderr=1 $caffe_root/build/tools/convert_imageset \ --resize_height=256 \ --resize_width=256 \ --shuffle \ $caffe_root/examples/caltech101/caltech101_train/ \ $caffe_root/data/caltech101/caltech101_train.txt \ $caffe_root/examples/caltech101/caltech101_train_lmdb echo "creating val lmdb..." glog_logtostderr=1 $tools/convert_imageset \ --resize_height=256 \ --resize_width=256 \ --shuffle \ $caffe_root/examples/caltech101/caltech101_train/ \ $caffe_root/data/caltech101/caltech101_test.txt \ $caffe_root/examples/caltech101/caltech101_test_lmdb echo "done."
also, after executing create.sh, output :
root@samar-dell-precision-m3800:~/caffe# ./examples/caltech101/create_caltech101.sh creating train lmdb... i0701 20:17:34.589217 3256 convert_imageset.cpp:86] shuffling data i0701 20:17:34.589913 3256 convert_imageset.cpp:89] total of 84 images. i0701 20:17:34.590143 3256 db_lmdb.cpp:35] opened lmdb /home/samar/caffe/examples/caltech101/caltech101_train_lmdb e0701 20:17:34.645048 3256 io.cpp:80] not open or find file /home/samar/caffe/examples/caltech101/caltech101_train/ i0701 20:17:34.768301 3256 convert_imageset.cpp:153] processed 83 files. creating val lmdb... i0701 20:17:34.787917 3258 convert_imageset.cpp:86] shuffling data i0701 20:17:34.788311 3258 convert_imageset.cpp:89] total of 40 images. i0701 20:17:34.788477 3258 db_lmdb.cpp:35] opened lmdb /home/samar/caffe/examples/caltech101/caltech101_test_lmdb i0701 20:17:34.872882 3258 convert_imageset.cpp:153] processed 40 files. done.
two files including caltech101_train_lmdb , caltech101_test_lmdb created size in unknown.
thank great help.
first of all, use absolute paths variables:
example data tools train_data_root val_data_root
next, seem have 84 images. if case, db small. check if have provided training , validation images properly. need have 2 text files - 1 training , validation. in each file you'll have 2 columns. in each row first column contains path image , second column has corresponding label. label number. 2 columns separated space.
Comments
Post a Comment