From ef055ca517d6cfe2c1353b8cd4645a8bf2cf1d25 Mon Sep 17 00:00:00 2001 From: Weiyi Zheng Date: Fri, 2 Sep 2016 17:34:47 -0400 Subject: [PATCH] fixing bilinear filler error --- include/caffe/filler.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/caffe/filler.hpp b/include/caffe/filler.hpp index dad9ad46b3b..c72fddeb6ca 100644 --- a/include/caffe/filler.hpp +++ b/include/caffe/filler.hpp @@ -250,7 +250,7 @@ class BilinearFiller : public Filler { CHECK_EQ(blob->width(), blob->height()) << "Filter must be square"; Dtype* data = blob->mutable_cpu_data(); int f = ceil(blob->width() / 2.); - float c = (2 * f - 1 - f % 2) / (2. * f); + float c = (2 * f - 1 - blod->width() % 2) / (2. * f); for (int i = 0; i < blob->count(); ++i) { float x = i % blob->width(); float y = (i / blob->width()) % blob->height();