From ec3d050a76ee8c41f35c4531d3fa07a2d9c28ed3 Mon Sep 17 00:00:00 2001
From: Joseph Redmon <pjreddie@gmail.com>
Date: Thu, 02 Jun 2016 22:25:24 +0000
Subject: [PATCH] hope i didn't break anything

---
 src/parser.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/src/parser.c b/src/parser.c
index 5a9d0a3..d12b5c1 100644
--- a/src/parser.c
+++ b/src/parser.c
@@ -257,6 +257,7 @@
     layer.softmax = option_find_int(options, "softmax", 0);
     layer.sqrt = option_find_int(options, "sqrt", 0);
 
+    layer.max_boxes = option_find_int_quiet(options, "max",30);
     layer.coord_scale = option_find_float(options, "coord_scale", 1);
     layer.forced = option_find_int(options, "forced", 0);
     layer.object_scale = option_find_float(options, "object_scale", 1);
@@ -524,6 +525,7 @@
     params.batch = net.batch;
     params.time_steps = net.time_steps;
 
+    size_t workspace_size = 0;
     n = n->next;
     int count = 0;
     free_section(s);
@@ -584,6 +586,7 @@
         l.dontloadscales = option_find_int_quiet(options, "dontloadscales", 0);
         option_unused(options);
         net.layers[count] = l;
+        if (l.workspace_size > workspace_size) workspace_size = l.workspace_size;
         free_section(s);
         n = n->next;
         ++count;
@@ -597,6 +600,14 @@
     free_list(sections);
     net.outputs = get_network_output_size(net);
     net.output = get_network_output(net);
+    if(workspace_size){
+    //printf("%ld\n", workspace_size);
+#ifdef GPU
+        net.workspace = cuda_make_array(0, (workspace_size-1)/sizeof(float)+1);
+#else
+        net.workspace = calloc(1, workspace_size);
+#endif
+    }
     return net;
 }
 

--
Gitblit v1.10.0