Skip to content

Commit 44e5944

Browse files
committed
fixed unexpected exit in Caffe
1 parent 9e43d75 commit 44e5944

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tools/caffe.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,11 +436,13 @@ int main(int argc, char** argv) {
436436
// PS INIT
437437
ps::Start(0);
438438
caffe::GlobalInit(&argc, &argv);
439+
int ret = 0;
439440
if (argc == 2) {
440441
#ifdef WITH_PYTHON_LAYER
441442
try {
442443
#endif
443-
return GetBrewFunction(caffe::string(argv[1]))();
444+
//return GetBrewFunction(caffe::string(argv[1]))();
445+
ret = GetBrewFunction(caffe::string(argv[1]))();
444446
#ifdef WITH_PYTHON_LAYER
445447
} catch (bp::error_already_set) {
446448
PyErr_Print();
@@ -452,4 +454,5 @@ int main(int argc, char** argv) {
452454
}
453455
// PS DISPOSE
454456
ps::Finalize(0, true);
457+
return ret;
455458
}

0 commit comments

Comments
 (0)