From 481b57a96a9ef29b112caec1bb3e17ffb043ceae Mon Sep 17 00:00:00 2001
From: Joseph Redmon <pjreddie@gmail.com>
Date: Sun, 25 Sep 2016 06:12:54 +0000
Subject: [PATCH] So I have this new programming paradigm.......

---
 src/classifier.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/classifier.c b/src/classifier.c
index b42d010..208b7ed 100644
--- a/src/classifier.c
+++ b/src/classifier.c
@@ -10,6 +10,7 @@
 
 #ifdef OPENCV
 #include "opencv2/highgui/highgui_c.h"
+image get_image_from_stream(CvCapture *cap);
 #endif
 
 list *read_data_cfg(char *filename)
@@ -57,25 +58,26 @@
 #ifdef GPU
     int i;
 
-    srand(time(0));
     float avg_loss = -1;
     char *base = basecfg(cfgfile);
     printf("%s\n", base);
     printf("%d\n", ngpus);
     network *nets = calloc(ngpus, sizeof(network));
+
+    srand(time(0));
+    int seed = rand();
     for(i = 0; i < ngpus; ++i){
+        srand(seed);
         cuda_set_device(gpus[i]);
         nets[i] = parse_network_cfg(cfgfile);
-        if(clear) *nets[i].seen = 0;
         if(weightfile){
             load_weights(&nets[i], weightfile);
         }
-    }
-    network net = nets[0];
-    for(i = 0; i < ngpus; ++i){
-        *nets[i].seen = *net.seen;
+        if(clear) *nets[i].seen = 0;
         nets[i].learning_rate *= ngpus;
     }
+    srand(time(0));
+    network net = nets[0];
 
     int imgs = net.batch * net.subdivisions * ngpus;
 

--
Gitblit v1.10.0