hdf5 feature extraction

614 views
Skip to first unread message

Lukas Hermann

unread,
Apr 27, 2015, 7:12:55 AM4/27/15
to caffe...@googlegroups.com
Hi, I trained a model for regression of hand poses with hdf5 input images and want to extract features with the "extract_features.bin" like in this tutorial:

If I run the command with a minibatch size of 1 everything works well and I get the features stored in a leveldb.
But I would like to extract features of more than one image at the same, however increasing the minibatch size to 2 or more doesn't work, i get the following error:

E0427 13:09:44.761488  6299 extract_features.cpp:64] Using CPU
E0427 13:09:45.004751  6299 extract_features.cpp:134] Extacting Features
HDF5-DIAG: Error detected in HDF5 (1.8.11) thread 140470468909632:
  #000: ../../../src/H5F.c line 1586 in H5Fopen(): unable to open file
    major: File accessibilty
    minor: Unable to open file
  #001: ../../../src/H5F.c line 1275 in H5F_open(): unable to open file: time = Mon Apr 27 13:09:45 2015
, name = '0', tent_flags = 0
    major: File accessibilty
    minor: Unable to open file
  #002: ../../../src/H5FD.c line 987 in H5FD_open(): open failed
    major: Virtual File Layer
    minor: Unable to initialize object
  #003: ../../../src/H5FDsec2.c line 343 in H5FD_sec2_open(): unable to open file: name = '0', errno = 2, error message = 'No such file or directory', flags = 0, o_flags = 0
    major: File accessibilty
    minor: Unable to open file
F0427 13:09:45.015347  6299 hdf5_data_layer.cpp:32] Failed opening HDF5 file: 0
*** Check failure stack trace: ***
    @     0x7fc1d3e2adaa  (unknown)
    @     0x7fc1d3e2ace4  (unknown)
    @     0x7fc1d3e2a6e6  (unknown)
    @     0x7fc1d3e2d687  (unknown)
    @     0x7fc1d41be0e9  caffe::HDF5DataLayer<>::LoadHDF5FileData()
    @     0x7fc1d41bd535  caffe::HDF5DataLayer<>::Forward_cpu()
    @     0x7fc1d4234c02  caffe::Net<>::ForwardFromTo()
    @     0x7fc1d4234eb5  caffe::Net<>::ForwardPrefilled()
    @           0x408a2c  feature_extraction_pipeline<>()
    @     0x7fc1d325aec5  (unknown)
    @           0x403c0e  (unknown)
    @              (nil)  (unknown)


Somehow it is unable to handle more than one hdf5 file at the same time. Does anyone have a suggestion how to solve this?

Ashwani Rai

unread,
May 11, 2015, 10:50:15 PM5/11/15
to caffe...@googlegroups.com
Your train.txt and test.txt must only contain the hdf5 names and location.
For example:
home/user/caffe/hdf5_example/1.h5
home
/user/caffe/hdf5_example/2.h5
home
/user/caffe/hdf5_example/3.h5


From what I can see, caffe is reading a '0' and is looking for the file called 0 as well. 

The ImageDataLayer we’ll use expects labels after each filenames, so let’s add a 0 to the end of each line

Do not follow the above step for hdf5. 

Dibet Garcia

unread,
Jul 25, 2017, 8:44:49 AM7/25/17
to Caffe Users
I resolve the problem calling the method solver->Resolve()
Reply all
Reply to author
Forward
0 new messages