Could not open or find file

1,569 views
Skip to first unread message

Jalen Hawkins

unread,
Jun 13, 2016, 3:29:51 PM6/13/16
to Caffe Users
Good evening guys i have come into a new issue and havent found a solution for it. At first when i was creating my imageset i was getting 0 images in my data base. I have fixed it and it now says that i have 1000 images in the train db and 200 in the val db which is correct. but they truly aren't there. It is giving me the error of could not open or find file path/to/file/xxxx.jpg     x. Ive double checked my path and is has to be correct for it to use the .txt file corressponding to the train and val pictures. Does anyone know the solution to this issue?


Creating train lmdb...
I0613 14:32:13.795382 11531 convert_imageset.cpp:86] Shuffling data
I0613 14:32:13.795806 11531 convert_imageset.cpp:89] A total of 1000 images.
I0613 14:32:13.795958 11531 db_lmdb.cpp:35] Opened lmdb examples/image1000test200/ilsvrc12_train_lmdb
E0613 14:32:13.795977 11531 io.cpp:80] Could not open or find file /home/addisonbe/caffe/examples/image1000test200/train730638000907.jpg 5
E0613 14:32:13.795999 11531 io.cpp:80] Could not open or find file /home/addisonbe/caffe/examples/image1000test200/train620474041369.jpg 2
E0613 14:32:13.796006 11531 io.cpp:80] Could not open or find file /home/addisonbe/caffe/examples/image1000test200/train620474044516.jpg 2
E0613 14:32:13.796013 11531 io.cpp:80] Could not open or find file /home/addisonbe/caffe/examples/image1000test200/train800128031124.jpg 6
E0613 14:32:13.796021 11531 io.cpp:80] Could not open or find file /home/addisonbe/caffe/examples/image1000test200/train680216001725.jpg 3
E0613 14:32:13.796030 11531 io.cpp:80] Could not open or find file /home/addisonbe/caffe/examples/image1000test200/train730181019890.jpg 4
E0613 14:32:13.796036 11531 io.cpp:80] Could not open or find file /home/addisonbe/caffe/examples/image1000test200/train150013038723.jpg 0
E0613 14:32:13.796043 11531 io.cpp:80] Could not open or find file /home/addisonbe/caffe/examples/image1000test200/train950056006361.jpg 9
E0613 14:32:13.796051 11531 io.cpp:80] Could not open or find file /home/addisonbe/caffe/examples/image1000test200/train730181017814.jpg 4


Creating val lmdb...
I0613 14:32:13.865803 11533 convert_imageset.cpp:86] Shuffling data
I0613 14:32:13.866156 11533 convert_imageset.cpp:89] A total of 200 images.
I0613 14:32:13.866366 11533 db_lmdb.cpp:35] Opened lmdb examples/image1000test200/ilsvrc12_val_lmdb
E0613 14:32:13.866395 11533 io.cpp:80] Could not open or find file /home/addisonbe/caffe/examples/image1000test200/val680216005275.jpg 3
E0613 14:32:13.866405 11533 io.cpp:80] Could not open or find file /home/addisonbe/caffe/examples/image1000test200/val680216005223.jpg 3
E0613 14:32:13.866410 11533 io.cpp:80] Could not open or find file /home/addisonbe/caffe/examples/image1000test200/val680216001437.jpg 3
E0613 14:32:13.866417 11533 io.cpp:80] Could not open or find file /home/addisonbe/caffe/examples/image1000test200/val730638006580.jpg 5
E0613 14:32:13.866425 11533 io.cpp:80] Could not open or find file /home/addisonbe/caffe/examples/image1000test200/val800128036156.jpg 6
E0613 14:32:13.866430 11533 io.cpp:80] Could not open or find file /home/addisonbe/caffe/examples/image1000test200/val680216001449.jpg 3
E0613 14:32:13.866436 11533 io.cpp:80] Could not open or find file /home/addisonbe/caffe/examples/image1000test200/val620474047253.jpg 2

Anne

unread,
Jun 14, 2016, 3:54:02 AM6/14/16
to Caffe Users
Hi,

Maybe your pictures are .jpeg and not .jpg but I suppose you've checked that too.
Or, maybe your images are supposed to be in examples/image1000test200/ilsvrc12_val_lmdb/, and as a consequence you only need to put "val680216005275.jpg 3" in you .txt file
Hope it helps

Jalen Hawkins

unread,
Jun 14, 2016, 11:43:15 AM6/14/16
to Caffe Users

I attached a screenshot of the .txt file and the folder with the pictures in it. Heres my create_imagenet.sh file.
 #!/usr/bin/env sh
# Create the imagenet lmdb inputs
# N.B. set the path to the imagenet train + val data dirs

EXAMPLE=examples/image1000test200
DATA=example/image1000test200
TOOLS=build/tools

TRAIN_DATA_ROOT=/home/addisonbe/caffe/examples/image1000test200/train
VAL_DATA_ROOT=/home/addisonbe/caffe/examples/image1000test200/val

# Set RESIZE=true to resize the images to 256x256. Leave as false if images have
# already been resized using another tool.
RESIZE=true
if $RESIZE; then
  RESIZE_HEIGHT=227
  RESIZE_WIDTH=227
else
  RESIZE_HEIGHT=0
  RESIZE_WIDTH=0
fi

if [ ! -d "$TRAIN_DATA_ROOT" ]; then
  echo "Error: TRAIN_DATA_ROOT is not a path to a directory: $TRAIN_DATA_ROOT"
  echo "Set the TRAIN_DATA_ROOT variable in create_imagenet.sh to the path" \
       "where the ImageNet training data is stored."
  exit 1
fi

if [ ! -d "$VAL_DATA_ROOT" ]; then
  echo "Error: VAL_DATA_ROOT is not a path to a directory: $VAL_DATA_ROOT"
  echo "Set the VAL_DATA_ROOT variable in create_imagenet.sh to the path" \
       "where the ImageNet validation data is stored."
  exit 1
fi

echo "Creating train lmdb..."

GLOG_logtostderr=1 $TOOLS/convert_imageset \
    --resize_height=$RESIZE_HEIGHT \
    --resize_width=$RESIZE_WIDTH \
    --shuffle \
    $TRAIN_DATA_ROOT/ \
    /home/addisonbe/caffe/examples/image1000test200/train.txt \
    $EXAMPLE/ilsvrc12_train_lmdb

echo "Creating val lmdb..."

GLOG_logtostderr=1 $TOOLS/convert_imageset \
    --resize_height=$RESIZE_HEIGHT \
    --resize_width=$RESIZE_WIDTH \
    --shuffle \
    /home/addisonbe/caffe/examples/image1000test200/val/  \
    /home/addisonbe/caffe/examples/image1000test200/val.txt \
    $EXAMPLE/ilsvrc12_val_lmdb

echo "Done."


i dont see where the issue in my path is.
Screenshot from 2016-06-14 11-40-05.png

William Schaller

unread,
Jun 15, 2016, 1:20:15 PM6/15/16
to Caffe Users
Your path needs a slash after train and val. 

Change 

TRAIN_DATA_ROOT=/home/addisonbe/caffe/examples/image1000test200/train
VAL_DATA_ROOT
=/home/addisonbe/caffe/examples/image1000test200/val

to

TRAIN_DATA_ROOT=/home/addisonbe/caffe/examples/image1000test200/train/
VAL_DATA_ROOT
=/home/addisonbe/caffe/examples/image1000test200/val/

Reply all
Reply to author
Forward
0 new messages