From 8322a58cf69e79ff1847634ede1a2a1b2e71e6d6 Mon Sep 17 00:00:00 2001
From: Joseph Redmon <pjreddie@gmail.com>
Date: Tue, 14 Jun 2016 18:30:28 +0000
Subject: [PATCH] hate warnings

---
 src/detection_layer.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/detection_layer.c b/src/detection_layer.c
index e103b4e..f7019ef 100644
--- a/src/detection_layer.c
+++ b/src/detection_layer.c
@@ -133,6 +133,9 @@
                         best_index = 0;
                     }
                 }
+                if(1 && *(state.net.seen) < 100000){
+                    best_index = rand()%l.n;
+                }
 
                 int box_index = index + locations*(l.classes + l.n) + (i*l.n + best_index) * l.coords;
                 int tbox_index = truth_index + 1 + l.classes;
@@ -181,7 +184,6 @@
             for (b = 0; b < l.batch; ++b) {
                 int index = b*l.inputs;
                 for (i = 0; i < locations; ++i) {
-                    int truth_index = (b*locations + i)*(1+l.coords+l.classes);
                     for (j = 0; j < l.n; ++j) {
                         int p_index = index + locations*l.classes + i*l.n + j;
                         costs[b*locations*l.n + i*l.n + j] = l.delta[p_index]*l.delta[p_index];
@@ -194,7 +196,6 @@
             for (b = 0; b < l.batch; ++b) {
                 int index = b*l.inputs;
                 for (i = 0; i < locations; ++i) {
-                    int truth_index = (b*locations + i)*(1+l.coords+l.classes);
                     for (j = 0; j < l.n; ++j) {
                         int p_index = index + locations*l.classes + i*l.n + j;
                         if (l.delta[p_index]*l.delta[p_index] < cutoff) l.delta[p_index] = 0;
@@ -233,7 +234,7 @@
         cuda_pull_array(state.truth, truth_cpu, num_truth);
     }
     cuda_pull_array(state.input, in_cpu, l.batch*l.inputs);
-    network_state cpu_state;
+    network_state cpu_state = state;
     cpu_state.train = state.train;
     cpu_state.truth = truth_cpu;
     cpu_state.input = in_cpu;

--
Gitblit v1.10.0