diff --git a/src/caffe/test/test_data/generate_sample_data.py b/src/caffe/test/test_data/generate_sample_data.py index 0d8f5aa98e3..0516eff9158 100644 --- a/src/caffe/test/test_data/generate_sample_data.py +++ b/src/caffe/test/test_data/generate_sample_data.py @@ -14,7 +14,10 @@ data = np.arange(total_size) data = data.reshape(num_rows, num_cols, height, width) data = data.astype('float32') -label = np.arange(num_rows)[:, np.newaxis] + +# We had a bug where data was copied into label, but the tests weren't +# catching it, so let's make label 1-indexed. +label = 1 + np.arange(num_rows)[:, np.newaxis] label = label.astype('float32') print data diff --git a/src/caffe/test/test_data/sample_data.h5 b/src/caffe/test/test_data/sample_data.h5 index a1f923a71ae..cb327573cae 100644 Binary files a/src/caffe/test/test_data/sample_data.h5 and b/src/caffe/test/test_data/sample_data.h5 differ diff --git a/src/caffe/test/test_data/sample_data_2_gzip.h5 b/src/caffe/test/test_data/sample_data_2_gzip.h5 index 56c0a740ec2..b3d187cb1da 100644 Binary files a/src/caffe/test/test_data/sample_data_2_gzip.h5 and b/src/caffe/test/test_data/sample_data_2_gzip.h5 differ diff --git a/src/caffe/test/test_hdf5_output_layer.cpp b/src/caffe/test/test_hdf5_output_layer.cpp index 221d62aa2d2..ec48fc4fc32 100644 --- a/src/caffe/test/test_hdf5_output_layer.cpp +++ b/src/caffe/test/test_hdf5_output_layer.cpp @@ -62,7 +62,7 @@ void HDF5OutputLayerTest::CheckBlobEqual(const Blob& b1, for (int c = 0; c < b1.channels(); ++c) { for (int h = 0; h < b1.height(); ++h) { for (int w = 0; w < b1.width(); ++w) { - EXPECT_EQ(b1.data_at(n, c, h, w), b1.data_at(n, c, h, w)); + EXPECT_EQ(b1.data_at(n, c, h, w), b2.data_at(n, c, h, w)); } } }