i convert a caffemodel to caffe2 pb model,(actually it is the CMU openpose coco model) and i have succeeded predict on PC using caffe2 python API.
Then i simplely change the model to mine in demo AI Camera Demo and Tutorial But it failed when loadToNetDef ,net->ParseFromArray(data, len) returned false and the log says "Couldn't parse net from data" .
Then i find similar problem on github, someone said it worked after changing the prototxt input layer. So i rewrite the input layer referring to squeezenet like this:
before: input: "image" input_shape { dim: 1 dim: 3 dim: 368 dim: 368 }
i convert a caffemodel to caffe2 pb model,(actually it is the CMU openpose coco model) and i have succeeded predict on PC using caffe2 python API.
Then i simplely change the model to mine in demo
AI Camera Demo and Tutorial
But it failed whenloadToNetDef
,net->ParseFromArray(data, len)
returned false and the log says "Couldn't parse net from data" .Then i find similar problem on github, someone said it worked after changing the prototxt input layer. So i rewrite the input layer referring to squeezenet like this: before:
input: "image" input_shape { dim: 1 dim: 3 dim: 368 dim: 368 }
after:
layer { name: "image" type: "Input" top: "image" input_param { shape: { dim: 1 dim: 3 dim: 368 dim: 368 } } }
it still failed when
loadToNetDef(mgr, &_initNet, "init_net.pb");
but it worked whenloadToNetDef(mgr, &_predictNet,"predict_net.pb");
So, is there ways to solve the problem ? How can i use a new model with caffe2 on Android?