MCPcopy Create free account
hub / github.com/OAID/Tengine / LoadModel

Method LoadModel

tengine-module/plugin/serializer/darknet/darknet_serializer.cpp:128–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

126}
127
128bool 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}
151static bool LoadConvBlob(StaticGraph *graph,StaticNode* node,std::vector<int> &weight_dims,int batch_norm,FILE* fp)
152{
153 if(fp == NULL)

Callers

nothing calls this directly

Calls 9

read_cfgFunction · 0.85
free_listFunction · 0.85
SetGraphSourceFunction · 0.85
SetGraphSourceFormatFunction · 0.85
SetGraphLayoutFunction · 0.85
SetModelLayoutFunction · 0.85
SetModelFormatFunction · 0.85
sizeMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected