From cf0300ea55538d4ca139d68cd24b0ee452cce015 Mon Sep 17 00:00:00 2001 From: Joseph Redmon Date: Fri, 27 Mar 2015 17:32:01 -0700 Subject: [PATCH] dropout probably ok --- Makefile | 2 +- src/cuda.c | 3 ++- src/darknet.c | 1 + src/dropout_layer_kernels.cu | 2 ++ 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index f474fcee..0728872b 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ GPU=1 DEBUG=0 -ARCH= -arch=sm_50 +ARCH= -arch=sm_52 VPATH=./src/ EXEC=darknet diff --git a/src/cuda.c b/src/cuda.c index fb7485e2..1b914a57 100644 --- a/src/cuda.c +++ b/src/cuda.c @@ -7,6 +7,7 @@ int gpu_index = 0; #include "blas.h" #include "assert.h" #include +#include void check_error(cudaError_t status) @@ -65,7 +66,7 @@ void cuda_random(float *x_gpu, int n) static int init = 0; if(!init){ curandCreateGenerator(&gen, CURAND_RNG_PSEUDO_DEFAULT); - curandSetPseudoRandomGeneratorSeed(gen, 0ULL); + curandSetPseudoRandomGeneratorSeed(gen, time(0)); init = 1; } curandGenerateUniform(gen, x_gpu, n); diff --git a/src/darknet.c b/src/darknet.c index dbb30e0d..037b8de3 100644 --- a/src/darknet.c +++ b/src/darknet.c @@ -68,6 +68,7 @@ void partial(char *cfgfile, char *weightfile, char *outfile, int max) if(weightfile){ load_weights_upto(&net, weightfile, max); } + //net.seen = 0; save_weights(net, outfile); } diff --git a/src/dropout_layer_kernels.cu b/src/dropout_layer_kernels.cu index 231497d4..3dfa6410 100644 --- a/src/dropout_layer_kernels.cu +++ b/src/dropout_layer_kernels.cu @@ -16,11 +16,13 @@ void forward_dropout_layer_gpu(dropout_layer layer, network_state state) if (!state.train) return; int size = layer.inputs*layer.batch; cuda_random(layer.rand_gpu, size); + /* int i; for(i = 0; i < size; ++i){ layer.rand[i] = rand_uniform(); } cuda_push_array(layer.rand_gpu, layer.rand, size); + */ yoloswag420blazeit360noscope<<>>(state.input, size, layer.rand_gpu, layer.probability, layer.scale); check_error(cudaPeekAtLastError());