We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 48a7adf commit b060aa1Copy full SHA for b060aa1
1 file changed
tools/caffe.cpp
@@ -134,9 +134,13 @@ int train() {
134
// If the gpus flag is not provided, allow the mode and device to be set
135
// in the solver prototxt.
136
if (FLAGS_gpu.size() == 0
137
- && solver_param.solver_mode() == caffe::SolverParameter_SolverMode_GPU
138
- && solver_param.has_device_id()) {
139
- FLAGS_gpu = "" + boost::lexical_cast<string>(solver_param.device_id());
+ && solver_param.solver_mode() == caffe::SolverParameter_SolverMode_GPU) {
+ if (solver_param.has_device_id()) {
+ FLAGS_gpu = "" +
140
+ boost::lexical_cast<string>(solver_param.device_id());
141
+ } else { // Set default GPU if unspecified
142
+ FLAGS_gpu = "" + boost::lexical_cast<string>(0);
143
+ }
144
}
145
146
vector<int> gpus;
0 commit comments