From 5a05d91cb9e87d81732ab25da6811d053ea90b7c Mon Sep 17 00:00:00 2001 From: Josh Klontz Date: Thu, 5 Nov 2015 12:32:00 -0500 Subject: [PATCH] fixed memory aliasing bug and caffe verbose output --- openbr/plugins/classification/caffe.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openbr/plugins/classification/caffe.cpp b/openbr/plugins/classification/caffe.cpp index 7445391..c0d160d 100644 --- a/openbr/plugins/classification/caffe.cpp +++ b/openbr/plugins/classification/caffe.cpp @@ -45,6 +45,7 @@ private: CaffeNet *net = new CaffeNet(model, caffe::TEST); net->CopyTrainedLayersFrom(weights.toStdString()); + FLAGS_minloglevel = google::ERROR; // Disable Caffe's verbose output after loading the first model return net; } }; @@ -104,7 +105,7 @@ protected: int dimFeatures = output->count() / dataLayer->batch_size(); for (int n = 0; n < dataLayer->batch_size(); n++) - dst += Mat(1, dimFeatures, CV_32FC1, output->mutable_cpu_data() + output->offset(n)); + dst += Mat(1, dimFeatures, CV_32FC1, output->mutable_cpu_data() + output->offset(n)).clone(); caffeResource.release(net); } -- libgit2 0.21.4