Skip to content

Commit

Permalink
FIX: tests now catch bug reported in BVLC#750 (in HDF5 output layer)
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeyk committed Jul 28, 2014
1 parent 7752032 commit cbc507e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/caffe/test/test_data/generate_sample_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Binary file modified src/caffe/test/test_data/sample_data.h5
Binary file not shown.
Binary file modified src/caffe/test/test_data/sample_data_2_gzip.h5
Binary file not shown.
2 changes: 1 addition & 1 deletion src/caffe/test/test_hdf5_output_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void HDF5OutputLayerTest<TypeParam>::CheckBlobEqual(const Blob<Dtype>& 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));
}
}
}
Expand Down

0 comments on commit cbc507e

Please sign in to comment.