From 718f155e36cfabc96cefc41cc470ded6e11c8843 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EB=B0=95=EC=A2=85=ED=98=84/=EB=8F=99=EC=9E=91=EC=A0=9C?= =?utf8?q?=EC=96=B4Lab=28SR=29/Senior=20Engineer/=EC=82=BC=EC=84=B1?= =?utf8?q?=EC=A0=84=EC=9E=90?= Date: Tue, 8 May 2018 12:47:24 +0900 Subject: [PATCH] [caffekit] Run inference without caffemodel (#206) This commit revises 'caffekit run' to performe inference with random weight even when caffemodel is not provided. Signed-off-by: Jonghyun Park --- contrib/caffekit/src/caffekit.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/contrib/caffekit/src/caffekit.cpp b/contrib/caffekit/src/caffekit.cpp index 3ff0b95..23331c3 100644 --- a/contrib/caffekit/src/caffekit.cpp +++ b/contrib/caffekit/src/caffekit.cpp @@ -17,10 +17,14 @@ public: int RunCommand::run(int argc, char **argv) const { - // USAGE: HEADER run [.prototxt] [.caffemodel] + // USAGE: HEADER run [.prototxt] ([.caffemodel]) caffe::Net net(argv[0], caffe::TEST); - net.CopyTrainedLayersFrom(argv[1]); + if (argv[1] != nullptr) + { + net.CopyTrainedLayersFrom(argv[1]); + } + net.Forward(); std::cout << "# of outputs: " << net.num_outputs() << std::endl; -- 2.7.4