From: 박종현/동작제어Lab(SR)/Senior Engineer/삼성전자 Date: Tue, 8 May 2018 03:47:24 +0000 (+0900) Subject: [caffekit] Run inference without caffemodel (#206) X-Git-Tag: nncc_backup~2705 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=718f155e36cfabc96cefc41cc470ded6e11c8843;p=platform%2Fcore%2Fml%2Fnnfw.git [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 --- 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;