"...text-generation-inference.git" did not exist on "0e4ab6d31cbbaa3cc8be2046dfecfc5bde375494"
Commit e0f98d92 authored by Davis King's avatar Davis King
Browse files

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 @@ ...@@ -17,6 +17,7 @@
#include <vector> #include <vector>
#include "../smart_pointers.h" #include "../smart_pointers.h"
#include "../pipe.h" #include "../pipe.h"
#include <iostream>
namespace dlib namespace dlib
{ {
...@@ -64,6 +65,11 @@ namespace dlib ...@@ -64,6 +65,11 @@ namespace dlib
// invalid. In this case just return a cross validation score of 0. // invalid. In this case just return a cross validation score of 0.
result = 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