MCPcopy Create free account
hub / github.com/Xilinx/CHaiDNN / readDeployFile

Function readDeployFile

software/xtract/caffe_network_parser.cpp:3021–3041  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3019}
3020
3021void readDeployFile(const string& deployFile, caffe::NetParameter* Net)
3022{
3023 int fileDescriptor = open(deployFile.c_str(), O_RDONLY);
3024 if(fileDescriptor < 0)
3025 {
3026 cerr << "[EP001] Couldn't open the deploy file : " << deployFile << endl;
3027 exit(-1);
3028 }
3029
3030 // Merge the deploy file to caffe Net
3031 google::protobuf::io::FileInputStream* fileInput = new google::protobuf::io::FileInputStream(fileDescriptor);
3032 bool status = google::protobuf::TextFormat::Parse(fileInput, Net);
3033 if(!status)
3034 {
3035 cerr << "[EP002] Couldn't Parse the deploy file : " << deployFile << endl;
3036 exit(-1);
3037 }
3038
3039 delete fileInput;
3040 close(fileDescriptor);
3041}
3042
3043
3044void readModelFile(const string& caffemodelFile, caffe::NetParameter* Net)

Callers 1

ParseCaffeNetworkFunction · 0.85

Calls 1

c_strMethod · 0.45

Tested by

no test coverage detected