caffe2 icon indicating copy to clipboard operation
caffe2 copied to clipboard

fail to load the model in predictor_verifier.cc

Open jimmyoic opened this issue 9 years ago • 3 comments

Hi, I tried to use the predictor_verifier to test how to load the model (squeezenet in examples) by C++ API. (https://github.com/caffe2/caffe2/blob/master/caffe2/binaries/predictor_verifier.cc)

it failed by giving the following message after running the program:

image

is anything wrong with the code?

jimmyoic avatar May 01 '17 08:05 jimmyoic

This binary is for other models that have been produced by predictor_exporter. @aaronmarkham is working on an example and page which explains different kinds of model saving / loading approaches.

salexspb avatar May 01 '17 17:05 salexspb

Hi. As squeezenet can be ran in python without any problem, is there any example now for me to test caffe2 in C++ API?

Thanks.

jimmyoic avatar May 02 '17 06:05 jimmyoic

Android AI Camera https://caffe2.ai/docs/AI-Camera-demo-android

https://github.com/bwasti/AICamera/blob/master/app/src/main/cpp/native-lib.cpp

loadToNetDef(mgr, &_initNet, "squeeze_init_net.pb"); loadToNetDef(mgr, &_predictNet,"squeeze_predict_net.pb");

_predictor = new caffe2::Predictor(_initNet, _predictNet);

caffe2::Predictor::TensorVector input_vec{&input}; caffe2::Predictor::TensorVector output_vec;

_predictor->run(input_vec, &output_vec);

astroli avatar May 03 '17 13:05 astroli