summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Yeager <luke.yeager@gmail.com>2015-09-24 19:35:35 (GMT)
committerLuke Yeager <luke.yeager@gmail.com>2015-09-24 19:35:48 (GMT)
commit84e390c5a16347c7369f6c92cb62526e42ce73ac (patch)
treeb7439602d4f1daab0b3f7fda9fb89bebd2b91f2a
parent37dc63cf3609134eec7950faaee0467071994e96 (diff)
downloadcaffeonacl-84e390c5a16347c7369f6c92cb62526e42ce73ac.zip
caffeonacl-84e390c5a16347c7369f6c92cb62526e42ce73ac.tar.gz
caffeonacl-84e390c5a16347c7369f6c92cb62526e42ce73ac.tar.bz2
Allow H5T_INTEGER in HDF5 files
-rw-r--r--src/caffe/util/hdf5.cpp29
1 files changed, 28 insertions, 1 deletions
diff --git a/src/caffe/util/hdf5.cpp b/src/caffe/util/hdf5.cpp
index d0d05f7..7730e76 100644
--- a/src/caffe/util/hdf5.cpp
+++ b/src/caffe/util/hdf5.cpp
@@ -27,7 +27,34 @@ void hdf5_load_nd_dataset_helper(
status = H5LTget_dataset_info(
file_id, dataset_name_, dims.data(), &class_, NULL);
CHECK_GE(status, 0) << "Failed to get dataset info for " << dataset_name_;
- CHECK_EQ(class_, H5T_FLOAT) << "Expected float or double data";
+ switch (class_) {
+ case H5T_FLOAT:
+ LOG_FIRST_N(INFO, 1) << "Datatype class: H5T_FLOAT";
+ break;
+ case H5T_INTEGER:
+ LOG_FIRST_N(INFO, 1) << "Datatype class: H5T_INTEGER";
+ break;
+ case H5T_TIME:
+ LOG(FATAL) << "Unsupported datatype class: H5T_TIME";
+ case H5T_STRING:
+ LOG(FATAL) << "Unsupported datatype class: H5T_STRING";
+ case H5T_BITFIELD:
+ LOG(FATAL) << "Unsupported datatype class: H5T_BITFIELD";
+ case H5T_OPAQUE:
+ LOG(FATAL) << "Unsupported datatype class: H5T_OPAQUE";
+ case H5T_COMPOUND:
+ LOG(FATAL) << "Unsupported datatype class: H5T_COMPOUND";
+ case H5T_REFERENCE:
+ LOG(FATAL) << "Unsupported datatype class: H5T_REFERENCE";
+ case H5T_ENUM:
+ LOG(FATAL) << "Unsupported datatype class: H5T_ENUM";
+ case H5T_VLEN:
+ LOG(FATAL) << "Unsupported datatype class: H5T_VLEN";
+ case H5T_ARRAY:
+ LOG(FATAL) << "Unsupported datatype class: H5T_ARRAY";
+ default:
+ LOG(FATAL) << "Datatype class unknown";
+ }
vector<int> blob_dims(dims.size());
for (int i = 0; i < dims.size(); ++i) {