Commit e0f98d92 authored by Davis King's avatar Davis King

Changed code so that an error message is always printed if we run out of memory while

cross_validate_trainer_threaded() is executing.
parent daf47c0e
......@@ -17,6 +17,7 @@
#include <vector>
#include "../smart_pointers.h"
#include "../pipe.h"
#include <iostream>
namespace dlib
{
......@@ -64,6 +65,11 @@ namespace dlib
// invalid. In this case just return a cross validation score of 0.
result = 0;
}
catch (std::bad_alloc&)
{
std::cerr << "\nstd::bad_alloc thrown while running cross_validate_trainer_threaded(). Not enough memory.\n" << std::endl;
throw;
}
}
};
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment