GoogleNet cannot read images when field of type ImageData is used in train_val.prototxt

I am trying to use Caffe to implement GoogleNet. I want to train a deep web according to a list of files and labels in a text file, but the problem is when I train deep web, it cannot read the files.

Here are the definitions for train_val.prototxt where I am using ImageData instead of using large LMDB files of type "Data"

name: "GoogleNet"
layer 
  {
  name: "data"
  type: "ImageData"
  top: "data"
  top: "label"
  include {
  phase: TRAIN
 }
 transform_param 
 {
 mirror: true
 crop_size: 224
 mean_value: 104
 mean_value: 117
 mean_value: 123
 }
 data_param 
 {
  source: "path_to_file/file_paths_and_labels.txt"
  batch_size: 32
 }
}  

      

Here I used the ImageData type for googlenet, not the Data type as suggested here: LMDB files and how they are used for the caffe deep learning network

So, I have a text file (file_paths_and_labels.txt) where each line contains the following:

path_to_image label

      

where the path to the image is the image address and the label is the image label (there are 10 different labels).

I want to know exactly where I am going wrong because when I run the deep network preparation command

./build/tools/caffe train --solver=/my_home/dl-caffe/models/bvlc_googlenet/solver.prototxt 

      

I have the following error:

I0624 10:36:11.524896 15246 layer_factory.hpp:74] Creating layer data
I0624 10:36:11.524960 15246 net.cpp:84] Creating Layer data
I0624 10:36:11.524988 15246 net.cpp:338] data -> data
I0624 10:36:11.525046 15246 net.cpp:338] data -> label
I0624 10:36:11.525084 15246 net.cpp:113] Setting up data
I0624 10:36:11.525106 15246 image_data_layer.cpp:36] Opening file 
I0624 10:36:11.525146 15246 image_data_layer.cpp:51] A total of 0 images.
*** Aborted at 1435152971 (unix time) try "date -d @1435152971" if you   are using GNU date ***
PC: @     0x7f7060b70ee0 (unknown)
*** SIGSEGV (@0x0) received by PID 15246 (TID 0x7f706188aa40) from PID   0; stack trace: ***
@     0x7f7060511d40 (unknown)
@     0x7f7060b70ee0 (unknown)
@     0x7f706118587c std::operator+<>()
@     0x7f70611861e5 caffe::ImageDataLayer<>::DataLayerSetUp()
@     0x7f7061144ac6 caffe::BaseDataLayer<>::LayerSetUp()
@     0x7f7061144bc9 caffe::BasePrefetchingDataLayer<>::LayerSetUp()
@     0x7f70611d8ff2 caffe::Net<>::Init()
@     0x7f70611daab2 caffe::Net<>::Net()
@     0x7f70611e6c10 caffe::Solver<>::InitTrainNet()
@     0x7f70611e7d23 caffe::Solver<>::Init()
@     0x7f70611e7ef6 caffe::Solver<>::Solver()
@           0x40c4a0 caffe::GetSolver<>()
@           0x406471 train()
@           0x404a11 main
@     0x7f70604fcec5 (unknown)
@           0x404fbd (unknown)
Segmentation fault (core dumped)

      

I think GoogleNet is not finding data in my text file. What is the problem? the syntax of my train_val.prototxt file?

+3


source to share


2 answers


You are specifying the source using the wrong parameter. For IMAGE_DATA, you need to use image_data_param instead of data_param . Since you are specifying your source in the data_param and the ImageDataLayer looks at the image_data_param, the source value is an empty string. You can see this in the log here:

I0624 10:36:11.525106 15246 image_data_layer.cpp:36] Opening file 

      

The format of this line should be:



Opening file <filename>

      

while there is a blank space in your log next to "Open file".

+8


source


That I will be of use to people who will land here in the future. I had the same problem, but I was loading images from a file leveldb

.
And this error came when I copied the files leveldb

generated by the machine A , to another machine B , and tried to run caffe on B . The problem was resolved by restoring the files leveldb

again by car Bed and .



BTW. maybe anyone knows why the machine that the leveldb

generated matter was on?

0


source







All Articles