Anakin
Anakin copied to clipboard
Help!! Crash in Net init.
Thanks for the great library. I want to run mobilenet (in benchmark example) on ARM in jni and model was converted successfully. I follow the arm inference example classification.cpp. Model loaded successfully and graph.get_outs() returns OK. But when call Net<ARM, AK_FLOAT, Precision::FP32, OpRunType::SYNC> net_executer(graph, ctx1, true); app crashes. Crash context is following module in net.cpp.
template<typename Ttype, DataType Dtype, Precision Ptype, OpRunType RunType>
void Net<Ttype, Dtype, Ptype, RunType>::init(graph::Graph<Ttype, Dtype, Ptype>& graph,
OpContextPtr<Ttype> ctx) {
init_env(graph);
// shallow copy
_graph_p->CopyFrom(graph);
auto node_names_in_exec_order = graph.get_nodes_in_order();
// infer basic shape and parsing parameter from graph
for (auto& node_name : node_names_in_exec_order) {
auto node_ptr = (*_graph_p)[node_name];
//LOG(ERROR) << "get node " << node_name << ", op type " << node_ptr->get_op_name();
if (node_ptr->get_op_name() == "Output") {
continue;
}
// create operations
auto* op_pointer = OpFactory<Ttype, Dtype, Ptype>::Global()[node_ptr->get_op_name()]; // Crash
node_ptr->get_op_name() is "Input". Global().get_list_op_name() returns empty list.
What can be the issue? Hope to any suggestions.
if you linked static lib in your project, please add "-Wl,--whole-archive ${anakin_lib_static} -Wl,--no-whole-archive" in "target_link_libraries" in your CMakeList