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

Method CheckSnapshotWritePermissions

src/caffe/solver.cpp:421–436  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

419
420template <typename Dtype>
421void Solver<Dtype>::CheckSnapshotWritePermissions() {
422 if (Caffe::root_solver() && param_.snapshot()) {
423 CHECK(param_.has_snapshot_prefix())
424 << "In solver params, snapshot is specified but snapshot_prefix is not";
425 string probe_filename = SnapshotFilename(".tempfile");
426 std::ofstream probe_ofs(probe_filename.c_str());
427 if (probe_ofs.good()) {
428 probe_ofs.close();
429 std::remove(probe_filename.c_str());
430 } else {
431 LOG(FATAL) << "Cannot write to snapshot prefix '"
432 << param_.snapshot_prefix() << "'. Make sure "
433 << "that the directory exists and is writeable.";
434 }
435 }
436}
437
438template <typename Dtype>
439string Solver<Dtype>::SnapshotFilename(const string extension) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected