MCPcopy Create free account
hub / github.com/BVLC/caffe / CheckFile

Function CheckFile

python/caffe/_caffe.cpp:77–84  ·  view source on GitHub ↗

For convenience, check that input files can be opened, and raise an exception that boost will send to Python if not (caffe could still crash later if the input files are disturbed before they are actually used, but this saves frustration in most cases).

Source from the content-addressed store, hash-verified

75// later if the input files are disturbed before they are actually used, but
76// this saves frustration in most cases).
77static void CheckFile(const string& filename) {
78 std::ifstream f(filename.c_str());
79 if (!f.good()) {
80 f.close();
81 throw std::runtime_error("Could not open file " + filename);
82 }
83 f.close();
84}
85
86void CheckContiguousArray(PyArrayObject* arr, string name,
87 int channels, int height, int width) {

Callers 2

Net_InitFunction · 0.85
Net_Init_LoadFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected