arm_compute v18.11
diff --git a/examples/graph_vgg16.cpp b/examples/graph_vgg16.cpp
index 69b3a9d..482aab1 100644
--- a/examples/graph_vgg16.cpp
+++ b/examples/graph_vgg16.cpp
@@ -31,11 +31,7 @@
using namespace arm_compute::graph::frontend;
using namespace arm_compute::graph_utils;
-/** Example demonstrating how to implement VGG16's network using the Compute Library's graph API
- *
- * @param[in] argc Number of arguments
- * @param[in] argv Arguments
- */
+/** Example demonstrating how to implement VGG16's network using the Compute Library's graph API */
class GraphVGG16Example : public Example
{
public:
@@ -45,6 +41,16 @@
}
bool do_setup(int argc, char **argv) override
{
+ // Check if the system has enough RAM to run the example, systems with less than 2GB have
+ // to hint the API to minimize memory consumption otherwise it'll run out of memory and
+ // fail throwing the bad_alloc exception
+ arm_compute::MEMInfo meminfo;
+ const size_t mem_total = meminfo.get_total_in_kb();
+ if(mem_total <= arm_compute::MEMInfo::TWO_GB_IN_KB)
+ {
+ arm_compute::MEMInfo::set_policy(arm_compute::MemoryPolicy::MINIMIZE);
+ }
+
// Parse arguments
cmd_parser.parse(argc, argv);
@@ -240,6 +246,11 @@
/** Main program for VGG16
*
+ * Model is based on:
+ * https://arxiv.org/abs/1409.1556
+ * "Very Deep Convolutional Networks for Large-Scale Image Recognition"
+ * Karen Simonyan, Andrew Zisserman
+ *
* @note To list all the possible arguments execute the binary appended with the --help option
*
* @param[in] argc Number of arguments