I have some question when I want to convert the image and label to LMDB to train a net

812 views
Skip to first unread message

文小森

unread,
Jun 16, 2015, 3:40:11 AM6/16/15
to caffe...@googlegroups.com

























In the create_imagenet.sh, I modified the:
EXAMPLE=examples/mytask
#DATA=/home/cwt/work/caffe-master/data/mydata 
DATA=data/mydata
TOOLS=build/tools

TRAIN_DATA_ROOT=/home/cwt/work/caffe-master/data/mydata/train/
VAL_DATA_ROOT=/home/cwt/work/caffe-master/data/mydata/val/

    --shuffle \
    --gray \
    #/home/cwt/work/caffe-master/data/mydata/ \
    $TRAIN_DATA_ROOT \
    $DATA/train.txt \
    $EXAMPLE/face_train_lmdb
I want to know how to solve this problem, thank you very much !

文小森

unread,
Jun 16, 2015, 10:30:46 AM6/16/15
to caffe...@googlegroups.com
I solve the error,but now there's a new bug:E0616 22:24:01.614941 31956 io.cpp:77] Could not open or find file data/mydata/valfour1550.jpg
                                                                          E0616 22:24:01.614961 31956 io.cpp:77] Could not open or find file data/mydata/valthree6.jpg
I want to know how to solve the error?

在 2015年6月16日星期二 UTC+8下午3:40:11,文小森写道:

Axel Angel

unread,
Jun 17, 2015, 3:40:35 AM6/17/15
to caffe...@googlegroups.com
You need to be in the directory where data/mydata/valfour1550.jpg is the correct relative path OR you better use full absolute path to your files.

Ahmed Abobakr

unread,
Sep 28, 2015, 5:19:50 AM9/28/15
to Caffe Users
and be sure that train.txt contains "image name" not path  and label 

Du Guowei

unread,
Nov 22, 2015, 1:54:22 PM11/22/15
to Caffe Users

My create file:
TRAIN_DATA_ROOT=/home/mrdgw/caffe/examples/IMAGEDATA/Trainimage
VAL_DATA_ROOT=/home/mrdgw/caffe/examples/IMAGEDATA/Testimage

error:

Creating train lmdb...
I1123 02:50:42.356531  6107 convert_imageset.cpp:82] Shuffling data
I1123 02:50:42.360656  6107 convert_imageset.cpp:85] A total of 6 images.
I1123 02:50:42.362071  6107 db_lmdb.cpp:38] Opened lmdb examples/IMAGEDATA/imagedata_train_lmdb
E1123 02:50:42.362371  6107 io.cpp:80] Could not open or find file /home/mrdgw/caffe/examples/IMAGEDATA/Trainimaget1.JPEG
E1123 02:50:42.362573  6107 io.cpp:80] Could not open or find file /home/mrdgw/caffe/examples/IMAGEDATA/Trainimageo1.JPEG
E1123 02:50:42.362761  6107 io.cpp:80] Could not open or find file /home/mrdgw/caffe/examples/IMAGEDATA/Trainimaget2.JPEG
E1123 02:50:42.362957  6107 io.cpp:80] Could not open or find file /home/mrdgw/caffe/examples/IMAGEDATA/Trainimageo2.JPEG
E1123 02:50:42.363164  6107 io.cpp:80] Could not open or find file /home/mrdgw/caffe/examples/IMAGEDATA/Trainimaget3.JPEG
E1123 02:50:42.363366  6107 io.cpp:80] Could not open or find file /home/mrdgw/caffe/examples/IMAGEDATA/Trainimageo3.JPEG


Solution: Add a slash at the back of path.

TRAIN_DATA_ROOT=/home/mrdgw/caffe/examples/IMAGEDATA/Trainimage/
VAL_DATA_ROOT=/home/mrdgw/caffe/examples/IMAGEDATA/Testimage/

Result:
Creating train lmdb...
I1123 02:53:55.568172  6137 convert_imageset.cpp:82] Shuffling data
I1123 02:53:55.572579  6137 convert_imageset.cpp:85] A total of 6 images.
I1123 02:53:55.574064  6137 db_lmdb.cpp:38] Opened lmdb examples/IMAGEDATA/imagedata_train_lmdb
I1123 02:53:55.759043  6137 convert_imageset.cpp:152] Processed 6 files.

an...@acusense.ai

unread,
Feb 24, 2016, 6:20:38 PM2/24/16
to Caffe Users
can train.txt not handle absolute paths? I have been running into issues with it but no one has explicitly said to just use the image name only instead of the path. What is the the consensus?

Hichem Tounsi

unread,
Apr 15, 2017, 9:18:17 AM4/15/17
to Caffe Users
for the train.txt and val.txt you need to just put the images' names without the absolute path, then the label of each image. However, be careful, you need to put one and only one space between the name and the label ...good luck every one
Reply all
Reply to author
Forward
0 new messages