From e31d0ac1e033cff4b6bd42e9b0f9fb3060508073 Mon Sep 17 00:00:00 2001 From: Chiyuan Zhang Date: Fri, 26 Sep 2014 13:18:38 -0400 Subject: [PATCH 1/3] tweak test case to expose bug. --- src/caffe/test/test_data/generate_sample_data.py | 2 +- src/caffe/test/test_hdf5data_layer.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/caffe/test/test_data/generate_sample_data.py b/src/caffe/test/test_data/generate_sample_data.py index 0516eff9158..2ab238611d8 100644 --- a/src/caffe/test/test_data/generate_sample_data.py +++ b/src/caffe/test/test_data/generate_sample_data.py @@ -7,7 +7,7 @@ num_cols = 8 num_rows = 10 -height = 5 +height = 6 width = 5 total_size = num_cols * num_rows * height * width diff --git a/src/caffe/test/test_hdf5data_layer.cpp b/src/caffe/test/test_hdf5data_layer.cpp index acca75b19b1..78a45223b90 100644 --- a/src/caffe/test/test_hdf5data_layer.cpp +++ b/src/caffe/test/test_hdf5data_layer.cpp @@ -62,7 +62,7 @@ TYPED_TEST(HDF5DataLayerTest, TestRead) { hdf5_data_param->set_batch_size(batch_size); hdf5_data_param->set_source(*(this->filename)); int num_cols = 8; - int height = 5; + int height = 6; int width = 5; // Test that the layer setup got the correct parameters. From c85b14b02c425937a3937080d83a49da9e59fece Mon Sep 17 00:00:00 2001 From: Chiyuan Zhang Date: Fri, 26 Sep 2014 15:21:45 -0400 Subject: [PATCH 2/3] update HDF5 layer test data. --- src/caffe/test/test_data/sample_data.h5 | Bin 10184 -> 11784 bytes .../test/test_data/sample_data_2_gzip.h5 | Bin 9992 -> 10548 bytes src/caffe/test/test_hdf5data_layer.cpp | 4 ++-- 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/caffe/test/test_data/sample_data.h5 b/src/caffe/test/test_data/sample_data.h5 index cb327573cae5de98cb1008eb38a3372c229a499c..90eaaa56ec773b5de2303100a5611786c8d78766 100644 GIT binary patch delta 1685 zcmWmBy^bC=6b4}D+w5iuf6GE7x|kvmAq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8oh;N>&TSM zAWbImnm9uwj;RA8 Date: Fri, 26 Sep 2014 15:21:57 -0400 Subject: [PATCH 3/3] fix hdf5 data layer bug --- src/caffe/layers/hdf5_data_layer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/caffe/layers/hdf5_data_layer.cpp b/src/caffe/layers/hdf5_data_layer.cpp index 1f2a83582f2..3f1396a9acc 100644 --- a/src/caffe/layers/hdf5_data_layer.cpp +++ b/src/caffe/layers/hdf5_data_layer.cpp @@ -75,9 +75,9 @@ void HDF5DataLayer::LayerSetUp(const vector*>& bottom, // Reshape blobs. const int batch_size = this->layer_param_.hdf5_data_param().batch_size(); (*top)[0]->Reshape(batch_size, data_blob_.channels(), - data_blob_.width(), data_blob_.height()); + data_blob_.height(), data_blob_.width()); (*top)[1]->Reshape(batch_size, label_blob_.channels(), - label_blob_.width(), label_blob_.height()); + label_blob_.height(), label_blob_.width()); LOG(INFO) << "output data size: " << (*top)[0]->num() << "," << (*top)[0]->channels() << "," << (*top)[0]->height() << "," << (*top)[0]->width();