#define HDF5_NUM_DIMS 4
+namespace leveldb {
+// Forward declaration for leveldb::Options to be used in GetlevelDBOptions().
+class Options;
+}
+
namespace caffe {
using ::google::protobuf::Message;
return ReadImageToDatum(filename, label, 0, 0, datum);
}
+leveldb::Options GetLevelDBOptions();
template <typename Dtype>
void hdf5_load_nd_dataset_helper(
case DataParameter_DB_LEVELDB:
{
leveldb::DB* db_temp;
- leveldb::Options options;
+ leveldb::Options options = GetLevelDBOptions();
options.create_if_missing = false;
- options.max_open_files = 100;
LOG(INFO) << "Opening leveldb " << this->layer_param_.data_param().source();
leveldb::Status status = leveldb::DB::Open(
options, this->layer_param_.data_param().source(), &db_temp);
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/io/zero_copy_stream_impl.h>
#include <google/protobuf/text_format.h>
+#include <leveldb/db.h>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/highgui/highgui_c.h>
return true;
}
+leveldb::Options GetLevelDBOptions() {
+ // In default, we will return the leveldb option and set the max open files
+ // in order to avoid using up the operating system's limit.
+ leveldb::Options options;
+ options.max_open_files = 100;
+ return options;
+}
+
// Verifies format of data stored in HDF5 file and reshapes blob accordingly.
template <typename Dtype>
void hdf5_load_nd_dataset_helper(