After spending way too much time on this problem and trying endless solutions, I finally found what causes this issue. This error is particularly treacherous as in the most cases, it decides simply not to give an error message.
See the original thread here:
https://github.com/weiliu89/caffe/issues/669#issuecomment-339542120Before compiling, you must edit the source code a little bit. Go to caffe/src/caffe/util/math_functions.cpp and in line 247, you find this function, which you should edit to look like this:
void caffe_rng_uniform(const int n, Dtype a, Dtype b, Dtype* r) {
CHECK_GE(n, 0);
CHECK(r);
if (a > b) {
Dtype c = a;
a = b;
b = c;
}
CHECK_LE(a, b);
boost::uniform_real<Dtype> random_distribution(a, caffe_nextafter<Dtype>(b));
boost::variate_generator<caffe::rng_t*, boost::uniform_real<Dtype> >
variate_generator(caffe_rng(), random_distribution);
for (int i = 0; i < n; ++i) {
r[i] = variate_generator();
}
}Note that I just added an if statement (that switches the variables
a and
b if
a is larger than
b) and removed the
const flag in the parameter's line from
Dtype a and
Dtype b.
Then simply do:
$ make clean
$ make -j$(nproc)
$ make py -j$(nproc)
$ make test -j$(nproc)
$ make runtest -j$(nproc) # You should run the tests after compiling to make sure you don't run into any other unexpected error.
For me, this worked very well!