Open BlackDeal opened 5 years ago
I got the reason!!
Hi @BlackDeal,
May i know how you get to know that output nodes are "pred_sbbox/concat_2, pred_mbbox/concat_2, pred_lbbox/concat_2"; //output ops"
Because when i am trying to convert model into .dlc(which is Qualcomm SNPE format) its says that
ERROR_TF_NODE_NOT_FOUND_IN_GRAPH: Node not found in graph. Node name: pred_sbbox/concat_2
问题解决了吗?我也遇到类似问题想请教下,yolo3一共有三个尺度输出,你调用的时候是三个一起调用进行筛选?还是只选取里面一个输出啊?我是要部署在tensorflow安卓 demo上,但是输出的配置output name只有一个值需要修改
c++调用 pb模型, 应该需要先将 模型转换成 saved model格式, concat一个输出output name.
也就是说,您调用的时候,三个名字都进行了调用是吧,然后经过了一个筛选的过程。方便加下微信吗?或者QQ
------------------ 原始邮件 ------------------ 发件人: "Byronnar"<notifications@github.com>; 发送时间: 2019年11月20日(星期三) 上午9:36 收件人: "YunYang1994/tensorflow-yolov3"<tensorflow-yolov3@noreply.github.com>; 抄送: "烧火棍"<774219268@qq.com>; "Comment"<comment@noreply.github.com>; 主题: Re: [YunYang1994/tensorflow-yolov3] 我用c++接口调用已经训练好的pb模型,为什么提示Not found: FetchOutputs node pred_lbbox/concat_2: not found (#307)
c++调用 pb模型, 应该需要先将 模型转换成 saved model格式, concat一个输出output name.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.
好的,我像您说的大概进行了组合,对三个output-name进行了拼接 private static final String YOLO_OUTPUT_NAMES = "pred_sbbox/concat_2,pred_mbbox/concat_2,pred_lbbox/concat_2"; 我不知道这样在安卓里面是否正确,但是我做了这样的修改以后并没有报错
你用的代码就是上面那个? 我concat之后 ,可以在serving端部署.
yolov3 c++ tensorflow inference https://blog.csdn.net/helei001/article/details/109050576
int main(int argc, char* argv[]) {
string dataset = "../2.jpg"; string graph = "../yolov3_coco.pb"; string input_layer = "input/input_data"; //input ops string final_out = " pred_sbbox/concat_2, pred_mbbox/concat_2, pred_lbbox/concat_2"; //output ops string root_dir = "";
string classesFile = "coco.names"; std::ifstream ifs(classesFile.c_str()); string line; while (getline(ifs, line)) classes.push_back(line);
// We need to call this to set up global state for TensorFlow. tensorflow::port::InitMain(argv[0], &argc, &argv); if (argc > 1) { LOG(ERROR) << "Unknown argument " << argv[1] << "\n"; return -1; }
// First we load and initialize the model. std::unique_ptr session;
string graph_path = tensorflow::io::JoinPath(root_dir, graph);
//std::cout<<graph_path<<endl;
Status load_graph_status = LoadGraph(graph_path, &session);
// std::cout<<load_graph_status<<endl;
// return -1;
if (!load_graph_status.ok()) {
LOG(ERROR) << load_graph_status;
return -1;
}
cv::VideoCapture cap;
// std::cout<<cap.open(0)<<endl;
//return 0;
//if(!cap.open(0)) {
// return 0;
//}
//for(;;) {
// std::cout<<outputs[0].shape().DebugString()<<endl; //std::cout<<outputs[1].shape().DebugString()<<endl; //std::cout<<outputs[2].shape().DebugString()<<endl; //return -1; if (!run_status.ok()) { LOG(ERROR) << "Running model failed: " << run_status; return -1; } tensorflow::Scope con_name = tensorflow::Scope::NewRootScope();
// tfTensor2cvMat(run_con[0],outs); postprocess(rgbImage, outs);
// } return 0; }