| 126 | } |
| 127 | |
| 128 | bool DarkNetSerializer::LoadModel(const std::vector<std::string>& file_list, StaticGraph* graph) |
| 129 | { |
| 130 | if(file_list.size() != GetFileNum()) |
| 131 | return false; |
| 132 | |
| 133 | const char *cfg_file = file_list[0].c_str(); |
| 134 | list *sections = read_cfg(cfg_file); |
| 135 | // Read the weights get |
| 136 | const char * weight_file = file_list[1].c_str(); |
| 137 | if(nullptr == weight_file) |
| 138 | return false; |
| 139 | // Construct the Graph |
| 140 | ConstructGraph(graph,weight_file,sections); |
| 141 | |
| 142 | free_list(sections); |
| 143 | SetGraphSource(graph, file_list[0]); |
| 144 | SetGraphSourceFormat(graph, "darknet"); |
| 145 | SetGraphLayout(graph, TENGINE_LAYOUT_NCHW); |
| 146 | SetModelLayout(graph, TENGINE_LAYOUT_NCHW); |
| 147 | SetModelFormat(graph, MODEL_FORMAT_DARKNET); |
| 148 | |
| 149 | return true; |
| 150 | } |
| 151 | static bool LoadConvBlob(StaticGraph *graph,StaticNode* node,std::vector<int> &weight_dims,int batch_norm,FILE* fp) |
| 152 | { |
| 153 | if(fp == NULL) |
nothing calls this directly
no test coverage detected