GithubHelp home page GithubHelp logo

pjreddie / darknet Goto Github PK

View Code? Open in Web Editor NEW
25.6K 913.0 21.3K 6.37 MB

Convolutional Neural Networks

Home Page: http://pjreddie.com/darknet/

License: Other

C 90.42% Cuda 7.79% Makefile 0.33% Shell 0.21% Python 0.91% C++ 0.34%

darknet's Introduction

Darknet Logo

Darknet

Darknet is an open source neural network framework written in C and CUDA. It is fast, easy to install, and supports CPU and GPU computation.

Discord invite link for for communication and questions: https://discord.gg/zSq8rtW

YOLOv7:


Official YOLOv7 is more accurate and faster than YOLOv5 by 120% FPS, than YOLOX by 180% FPS, than Dual-Swin-T by 1200% FPS, than ConvNext by 550% FPS, than SWIN-L by 500% FPS.

YOLOv7 surpasses all known object detectors in both speed and accuracy in the range from 5 FPS to 160 FPS and has the highest accuracy 56.8% AP among all known real-time object detectors with 30 FPS or higher on GPU V100, batch=1.

  • YOLOv7-e6 (55.9% AP, 56 FPS V100 b=1) by +500% FPS faster than SWIN-L Cascade-Mask R-CNN (53.9% AP, 9.2 FPS A100 b=1)
  • YOLOv7-e6 (55.9% AP, 56 FPS V100 b=1) by +550% FPS faster than ConvNeXt-XL C-M-RCNN (55.2% AP, 8.6 FPS A100 b=1)
  • YOLOv7-w6 (54.6% AP, 84 FPS V100 b=1) by +120% FPS faster than YOLOv5-X6-r6.1 (55.0% AP, 38 FPS V100 b=1)
  • YOLOv7-w6 (54.6% AP, 84 FPS V100 b=1) by +1200% FPS faster than Dual-Swin-T C-M-RCNN (53.6% AP, 6.5 FPS V100 b=1)
  • YOLOv7x (52.9% AP, 114 FPS V100 b=1) by +150% FPS faster than PPYOLOE-X (51.9% AP, 45 FPS V100 b=1)
  • YOLOv7 (51.2% AP, 161 FPS V100 b=1) by +180% FPS faster than YOLOX-X (51.1% AP, 58 FPS V100 b=1)

more5


image


yolov7_640_1280


Scaled-YOLOv4:

YOLOv4:

For more information see the Darknet project website.

Expand

yolo_progress https://paperswithcode.com/sota/object-detection-on-coco


scaled_yolov4 AP50:95 - FPS (Tesla V100) Paper: https://arxiv.org/abs/2011.08036


YOLOv4Tiny


YOLOv4


OpenCV_TRT

Citation

@misc{https://doi.org/10.48550/arxiv.2207.02696,
  doi = {10.48550/ARXIV.2207.02696},
  url = {https://arxiv.org/abs/2207.02696},
  author = {Wang, Chien-Yao and Bochkovskiy, Alexey and Liao, Hong-Yuan Mark},
  keywords = {Computer Vision and Pattern Recognition (cs.CV), FOS: Computer and information sciences, FOS: Computer and information sciences},
  title = {YOLOv7: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors},
  publisher = {arXiv},
  year = {2022}, 
  copyright = {arXiv.org perpetual, non-exclusive license}
}
@misc{bochkovskiy2020yolov4,
      title={YOLOv4: Optimal Speed and Accuracy of Object Detection}, 
      author={Alexey Bochkovskiy and Chien-Yao Wang and Hong-Yuan Mark Liao},
      year={2020},
      eprint={2004.10934},
      archivePrefix={arXiv},
      primaryClass={cs.CV}
}
@InProceedings{Wang_2021_CVPR,
    author    = {Wang, Chien-Yao and Bochkovskiy, Alexey and Liao, Hong-Yuan Mark},
    title     = {{Scaled-YOLOv4}: Scaling Cross Stage Partial Network},
    booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
    month     = {June},
    year      = {2021},
    pages     = {13029-13038}
}

darknet's People

Contributors

agirbau avatar alexey-kamenev avatar alexeyab avatar alperencode avatar lilohuang avatar pjreddie avatar tjluyao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

darknet's Issues

How can I redirect output image by input parameter๏ผŸ

YOLO is indeed a great project for beginner as me ,
so... it is hard for me to find a way that redirect output image by input parameter.

For example,
./darknet detect cfg/yolo.cfg weights/yolo.weights data/dog.jpg
It returns 'predictions.png' just in current path.

How can I change output path ?

Thanks a lot !

YOLOv2 Loss Function

Hi @pjreddie ,

I am trying to re-implement your project, I wonder if I could hear your thought about how you construct the Loss Function.

loss

bx = sigmoid(tx) + cx
by = sigmoid(ty) + cy
bw = pw * exp(tw)
bh = ph * exp(th)

Where as:
tx, ty, tw, th : prediction from network

What I get confused is cx, cy : Are these values absolute or relative (to the size of ground truth bounding box)? Same as px, py.

To be honest, I was lost when looking at this Loss Function ( I believe it was for YOLOv1) : Is this Loss still applied in YOLOv2?

image

Any help would be greatly appreciated :)

Low precision inference?

Hi!
Are there plans for making a low precision inference mode like many other neural network frameworks out there?
Would be really helpful for embedded applications where we have very limited memory!

Avoid passing and returning structs by value

Whenever a new copy of a struct is not expressly required, a function should receive a struct by reference (pointer to struct) instead of by value. Also, returning a struct by value is likely always unnecessary as well. Passing large structs by value adds a lot of copying back and forth from one function call to another, and additionally it makes it very difficult to understand whether a given function should modify the original struct instance or just receive its content as input values.

A made-up (but working and compilable) example:

#include <stdio.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>

struct foo {
	size_t size;
	char *data;
	// Unused variables below become needless baggage during pass-by-value
	int barstool;
	int hippopotamus;
	int large_trout_in_vacuum;
	char put_stuff_here_for_no_reason[32];
};

static void print_object(struct foo *ptr) {
	printf("{ size=%d, data=%p }\n", ptr->size, ptr->data);
}

static void print_object_unnecessarily_by_value(struct foo val) {
	printf("{ size=%d, data=%p }\n", val.size, val.data);
}

static void alter_object(struct foo *ptr) {
	ptr->size += 13;
	ptr->data = realloc(ptr->data, ptr->size);
}

static struct foo alter_object_unnecessarily_by_value(struct foo val) {
	val.size += 13;
	val.data = realloc(val.data, val.size);
	return val;
}

int main(int argc, char **argv) {
	struct foo obj;
	memset(&obj, 0, sizeof(obj));
	print_object(&obj);
	
	// Avoid doing these
	obj = alter_object_unnecessarily_by_value(obj);
	print_object_unnecessarily_by_value(obj);

	// Do these instead
	alter_object(&obj);
	print_object(&obj);

	if (obj.data != NULL) free(obj.data);
	memset(&obj, 0, sizeof(obj));

	return 0;
}

Object detection is very slow

I have installed Cuda & OpenCV for object detection as written in docs.

And tried to detect objects on the video file and got nearly FPS: 2.8.

./darknet detector demo cfg/coco.data cfg/yolo.cfg yolo.weights video-file.mp4

Then I tried to use cudNN, but result was FPS: 2.0.

What should I do to get higher FPS?

Environment
Ubuntu 16.04
CUDA Version 8.0.61
OpenCV 3.2
GPU: GeForce 840M (2GB)
Driver: NVIDIA 375.66

No OpenCL support

Why do you lock this technology to a single hardware vendor by writing the accelerated bits in nvidia proprietary CUDA and not industry standard OpenCL?

Incorrect use of shared variables causes segfault in OpenMP parallel loops (src/gemm.c)

In the OpenMP-enabled code called from gemm_cpu(), the inner loops' iteration variables are declared before the #pragma omp parallel for directives. This makes snek sad.

The OpenMP specification says that the outermost loop's iteration variable (in this case int i) is implicitly private, but otherwise any previously declared variables (in this case j and k) are shared. As j and k are actually used as loop iteration variables inside the parallel region, making them shared causes the threads to piss all over each other's shit (I believe that's the technical term used in the OpenMP spec).

The fix is to add a private(i,j,k) clause to the directives. Going to do a pull request shortly.

Crash:

$ ./darknet nightmare cfg/jnet-conv.cfg jnet-conv.weights data/scream.jpg 16 -iters 1 -rounds 30
policy: Using default 'constant'
max_batches: Using default '0'
layer     filters    size              input                output
    0 conv     32  3 x 3 / 1    10 x  10 x   3   ->    10 x  10 x  32
    1 conv     32  3 x 3 / 1    10 x  10 x  32   ->    10 x  10 x  32
    2 max          2 x 2 / 2    10 x  10 x  32   ->     5 x   5 x  32
    3 conv     64  3 x 3 / 1     5 x   5 x  32   ->     5 x   5 x  64
    4 conv     64  3 x 3 / 1     5 x   5 x  64   ->     5 x   5 x  64
    5 max          2 x 2 / 2     5 x   5 x  64   ->     3 x   3 x  64
    6 conv    128  3 x 3 / 1     3 x   3 x  64   ->     3 x   3 x 128
    7 conv    128  3 x 3 / 1     3 x   3 x 128   ->     3 x   3 x 128
    8 max          2 x 2 / 2     3 x   3 x 128   ->     2 x   2 x 128
    9 conv    256  3 x 3 / 1     2 x   2 x 128   ->     2 x   2 x 256
   10 conv    256  3 x 3 / 1     2 x   2 x 256   ->     2 x   2 x 256
   11 max          2 x 2 / 2     2 x   2 x 256   ->     1 x   1 x 256
   12 conv    512  3 x 3 / 1     1 x   1 x 256   ->     1 x   1 x 512
   13 conv    512  3 x 3 / 1     1 x   1 x 512   ->     1 x   1 x 512
   14 max          2 x 2 / 2     1 x   1 x 512   ->     1 x   1 x 512
   15 conv   1024  3 x 3 / 1     1 x   1 x 512   ->     1 x   1 x1024
   16 conv   1024  3 x 3 / 1     1 x   1 x1024   ->     1 x   1 x1024
   17 max          2 x 2 / 2     1 x   1 x1024   ->     1 x   1 x1024
Loading weights from jnet-conv.weights...Done!
Iteration: 0, done
0 scream_jnet-conv_16_000000
Iteration: 0, Segmentation fault (core dumped)

GDB backtrace:

Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x000055e47e85a544 in gemm_tn (M=<optimized out>, N=<optimized out>, K=<optimized out>, ALPHA=<optimized out>, A=<optimized out>, lda=<optimized out>, B=<optimized out>, ldb=0, C=0x0, 
    ldc=0) at ./src/gemm.c:126
126	                C[i*ldc+j] += A_PART*B[k*ldb+j];
[Current thread is 1 (Thread 0x7f1ee3050700 (LWP 20304))]
(gdb) thread apply all bt full

Thread 4 (Thread 0x7f1ee3851700 (LWP 20303)):
#0  0x000055e47e85a544 in gemm_tn (M=<optimized out>, N=<optimized out>, K=<optimized out>, ALPHA=<optimized out>, A=<optimized out>, lda=<optimized out>, B=<optimized out>, ldb=0, C=0x0, 
    ldc=0) at ./src/gemm.c:126
        A_PART = -0.0224672705
        i = 578
        j = 32767
        k = -2140035008
#1  0x00007f1f02fc68be in gomp_thread_start (xdata=<optimized out>) at ../../../src/libgomp/team.c:120
        team = 0x55e480717770
        task = 0x55e480717e50
        data = <optimized out>
        pool = <optimized out>
        local_fn = 0x55e47e85a453 <gemm_tn._omp_fn.2>
        local_data = 0x7fff35fac540
#2  0x00007f1f02d9a494 in start_thread (arg=0x7f1ee3851700) at pthread_create.c:333
        __res = <optimized out>
        pd = 0x7f1ee3851700
        now = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {139770642896640, 1786075862227522468, 0, 140734099015583, 0, 139771178414144, -1804626774660181084, -1803850822966930524}, 
              mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
        not_first_call = <optimized out>
        pagesize_m1 = <optimized out>
        sp = <optimized out>
        freesize = <optimized out>
        __PRETTY_FUNCTION__ = "start_thread"
#3  0x00007f1f02adca8f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
No locals.

Thread 3 (Thread 0x7f1f036d4500 (LWP 20289)):
#0  0x000055e47e85a53d in gemm_tn (M=<optimized out>, N=<optimized out>, K=<optimized out>, ALPHA=<optimized out>, A=<optimized out>, lda=<optimized out>, B=<optimized out>, ldb=1152, 
    C=0x7f1eeced8010, ldc=1776) at ./src/gemm.c:126
        A_PART = 0.0450726002
        i = 2
        j = 0
        k = 1776
#1  0x00007f1f02fbda9f in GOMP_parallel (fn=0x55e47e85a453 <gemm_tn._omp_fn.2>, data=0x7fff35fac540, num_threads=4, flags=0) at ../../../src/libgomp/parallel.c:168
No locals.
#2  0x000055e47e85a8de in gemm_tn (M=M@entry=1152, N=N@entry=1776, K=<optimized out>, ALPHA=<optimized out>, A=<optimized out>, lda=lda@entry=1152, B=B@entry=0x7f1eef738010, ldb=1776, 
    C=0x7f1eeced8010, ldc=1776) at ./src/gemm.c:121
        j = 799
        k = 0
#3  0x000055e47e85aa3d in gemm_cpu (TA=TA@entry=1, TB=TB@entry=0, M=M@entry=1152, N=N@entry=1776, K=K@entry=128, ALPHA=ALPHA@entry=1, A=A@entry=0x7f1f0358b010, lda=1152, B=0x7f1eef738010, 
    ldb=1776, BETA=BETA@entry=0, C=0x7f1eeced8010, ldc=1776) at ./src/gemm.c:167
        i = <optimized out>
        j = <optimized out>
#4  0x000055e47e85abf5 in gemm (TA=TA@entry=1, TB=TB@entry=0, M=M@entry=1152, N=N@entry=1776, K=K@entry=128, ALPHA=ALPHA@entry=1, A=A@entry=0x7f1f0358b010, lda=1152, B=0x7f1eef738010, 
    ldb=1776, BETA=BETA@entry=0, C=0x7f1eeced8010, ldc=1776) at ./src/gemm.c:77
No locals.
#5  0x000055e47e82af86 in backward_convolutional_layer (l=..., net=...) at ./src/convolutional_layer.c:510
        a = 0x7f1f0358b010
        b = 0x7f1eef738010
        c = 0x7f1eeced8010
        im = 0x7f1ef05ab010
        i = 0
        m = 128
        n = 1152
        k = 1776
#6  0x000055e47e845650 in backward_network (net=...) at ./src/network.c:261
        l = {type = CONVOLUTIONAL, activation = LEAKY, cost_type = SSE, forward = 0x55e47e82a85b <forward_convolutional_layer>, backward = 0x55e47e82ac9c <backward_convolutional_layer>, 
          update = 0x55e47e829d5e <update_convolutional_layer>, forward_gpu = 0x0, backward_gpu = 0x0, update_gpu = 0x0, batch_normalize = 0, shortcut = 0, batch = 1, forced = 0, 
          flipped = 0, inputs = 227328, outputs = 227328, nweights = 147456, nbiases = 128, extra = 0, truths = 0, h = 48, w = 37, c = 128, out_h = 48, out_w = 37, out_c = 128, n = 128, 
          max_boxes = 0, groups = 0, size = 3, side = 0, stride = 1, reverse = 0, flatten = 0, spatial = 0, pad = 1, sqrt = 0, flip = 0, index = 0, binary = 0, xnor = 0, steps = 0, 
          hidden = 0, truth = 0, smooth = 0, dot = 0, angle = 0, jitter = 0, saturation = 0, exposure = 0, shift = 0, ratio = 0, learning_rate_scale = 1, softmax = 0, classes = 0, 
          coords = 0, background = 0, rescore = 0, objectness = 0, does_cost = 0, joint = 0, noadjust = 0, reorg = 0, log = 0, tanh = 0, alpha = 0, beta = 0, kappa = 0, coord_scale = 0, 
          object_scale = 0, noobject_scale = 0, mask_scale = 0, class_scale = 0, bias_match = 0, random = 0, thresh = 0, classfix = 0, absolute = 0, onlyforward = 0, stopbackward = 0, 
          dontload = 0, dontloadscales = 0, temperature = 0, probability = 0, scale = 0, cweights = 0x0, indexes = 0x0, input_layers = 0x0, input_sizes = 0x0, map = 0x0, rand = 0x0, 
          cost = 0x0, state = 0x0, prev_state = 0x0, forgot_state = 0x0, forgot_delta = 0x0, state_delta = 0x0, combine_cpu = 0x0, combine_delta_cpu = 0x0, concat = 0x0, concat_delta = 0x0, 
          binary_weights = 0x0, biases = 0x55e48071ad00, bias_updates = 0x55e4807180e0, scales = 0x0, scale_updates = 0x0, weights = 0x7f1f0358b010, weight_updates = 0x7f1f0275f010, 
          delta = 0x7f1eef738010, output = 0x7f1eefc09010, squared = 0x0, norms = 0x0, spatial_mean = 0x0, mean = 0x0, variance = 0x0, mean_delta = 0x0, variance_delta = 0x0, 
          rolling_mean = 0x0, rolling_variance = 0x0, x = 0x0, x_norm = 0x0, m = 0x0, v = 0x0, bias_m = 0x0, bias_v = 0x0, scale_m = 0x0, scale_v = 0x0, z_cpu = 0x0, r_cpu = 0x0, 
          h_cpu = 0x0, prev_state_cpu = 0x0, temp_cpu = 0x0, temp2_cpu = 0x0, temp3_cpu = 0x0, dh_cpu = 0x0, hh_cpu = 0x0, prev_cell_cpu = 0x0, cell_cpu = 0x0, f_cpu = 0x0, i_cpu = 0x0, 
          g_cpu = 0x0, o_cpu = 0x0, c_cpu = 0x0, dc_cpu = 0x0, binary_input = 0x0, input_layer = 0x0, self_layer = 0x0, output_layer = 0x0, reset_layer = 0x0, update_layer = 0x0, 
          state_layer = 0x0, input_gate_layer = 0x0, state_gate_layer = 0x0, input_save_layer = 0x0, state_save_layer = 0x0, input_state_layer = 0x0, state_state_layer = 0x0, 
          input_z_layer = 0x0, state_z_layer = 0x0, input_r_layer = 0x0, state_r_layer = 0x0, input_h_layer = 0x0, state_h_layer = 0x0, wz = 0x0, uz = 0x0, wr = 0x0, ur = 0x0, wh = 0x0, 
          uh = 0x0, uo = 0x0, wo = 0x0, uf = 0x0, wf = 0x0, ui = 0x0, wi = 0x0, ug = 0x0, wg = 0x0, softmax_tree = 0x0, workspace_size = 8183808}
        i = 7
        orig = {n = 17, batch = 1, seen = 0x55e480714030, t = 0x55e480714050, epoch = 0, subdivisions = 1, layers = 0x55e4807239e0, output = 0x55e4813fbb40, policy = CONSTANT, 
          learning_rate = 0.00999999978, momentum = 0.899999976, decay = 0.000500000024, gamma = 0, scale = 0, power = 4, time_steps = 1, step = 0, max_batches = 0, scales = 0x0, 
          steps = 0x0, num_steps = 0, burn_in = 0, adam = 0, B1 = 0, B2 = 0, eps = 0, inputs = 83916, outputs = 30720, truths = 30720, notruth = 0, h = 189, w = 148, c = 3, max_crop = 20, 
          min_crop = 10, center = 0, angle = 0, aspect = 1, exposure = 1, saturation = 1, hue = 0, gpu_index = -1, hierarchy = 0x0, input = 0x55e481b33ba0, truth = 0x55e481505aa0, 
          delta = 0x55e481419b50, workspace = 0x7f1eeced8010, train = 0, index = 0, cost = 0x55e480714070}
#7  0x000055e47e824323 in optimize_picture (net=net@entry=0x7fff35fade70, orig=..., max_layer=max_layer@entry=16, scale=<optimized out>, rate=rate@entry=0.0399999991, thresh=thresh@entry=1, 
    norm=norm@entry=1) at ./examples/nightmare.c:70
        dx = 1
        dy = 5
        flip = 0
        crop = {w = 352, h = 448, c = 3, data = 0x55e481797b80}
        im = {w = 148, h = 189, c = 3, data = 0x55e481b33ba0}
        last = {type = CONVOLUTIONAL, activation = LEAKY, cost_type = SSE, forward = 0x55e47e82a85b <forward_convolutional_layer>, backward = 0x55e47e82ac9c <backward_convolutional_layer>, 
          update = 0x55e47e829d5e <update_convolutional_layer>, forward_gpu = 0x0, backward_gpu = 0x0, update_gpu = 0x0, batch_normalize = 0, shortcut = 0, batch = 1, forced = 0, 
          flipped = 0, inputs = 30720, outputs = 30720, nweights = 9437184, nbiases = 1024, extra = 0, truths = 0, h = 6, w = 5, c = 1024, out_h = 6, out_w = 5, out_c = 1024, n = 1024, 
          max_boxes = 0, groups = 0, size = 3, side = 0, stride = 1, reverse = 0, flatten = 0, spatial = 0, pad = 1, sqrt = 0, flip = 0, index = 0, binary = 0, xnor = 0, steps = 0, 
          hidden = 0, truth = 0, smooth = 0, dot = 0, angle = 0, jitter = 0, saturation = 0, exposure = 0, shift = 0, ratio = 0, learning_rate_scale = 1, softmax = 0, classes = 0, 
          coords = 0, background = 0, rescore = 0, objectness = 0, does_cost = 0, joint = 0, noadjust = 0, reorg = 0, log = 0, tanh = 0, alpha = 0, beta = 0, kappa = 0, coord_scale = 0, 
          object_scale = 0, noobject_scale = 0, mask_scale = 0, class_scale = 0, bias_match = 0, random = 0, thresh = 0, classfix = 0, absolute = 0, onlyforward = 0, stopbackward = 0, 
          dontload = 0, dontloadscales = 0, temperature = 0, probability = 0, scale = 0, cweights = 0x0, indexes = 0x0, input_layers = 0x0, input_sizes = 0x0, map = 0x0, rand = 0x0, 
          cost = 0x0, state = 0x0, prev_state = 0x0, forgot_state = 0x0, forgot_delta = 0x0, state_delta = 0x0, combine_cpu = 0x0, combine_delta_cpu = 0x0, concat = 0x0, concat_delta = 0x0, 
          binary_weights = 0x0, biases = 0x55e4807837d0, bias_updates = 0x55e4807847e0, scales = 0x0, scale_updates = 0x0, weights = 0x7f1efbd94010, weight_updates = 0x7f1ef9993010, 
          delta = 0x55e481495b50, output = 0x55e4813fbb40, squared = 0x0, norms = 0x0, spatial_mean = 0x0, mean = 0x0, variance = 0x0, mean_delta = 0x0, variance_delta = 0x0, 
          rolling_mean = 0x0, rolling_variance = 0x0, x = 0x0, x_norm = 0x0, m = 0x0, v = 0x0, bias_m = 0x0, bias_v = 0x0, scale_m = 0x0, scale_v = 0x0, z_cpu = 0x0, r_cpu = 0x0, 
          h_cpu = 0x0, prev_state_cpu = 0x0, temp_cpu = 0x0, temp2_cpu = 0x0, temp3_cpu = 0x0, dh_cpu = 0x0, hh_cpu = 0x0, prev_cell_cpu = 0x0, cell_cpu = 0x0, f_cpu = 0x0, i_cpu = 0x0, 
          g_cpu = 0x0, o_cpu = 0x0, c_cpu = 0x0, dc_cpu = 0x0, binary_input = 0x0, input_layer = 0x0, self_layer = 0x0, output_layer = 0x0, reset_layer = 0x0, update_layer = 0x0, 
          state_layer = 0x0, input_gate_layer = 0x0, state_gate_layer = 0x0, input_save_layer = 0x0, state_save_layer = 0x0, input_state_layer = 0x0, state_state_layer = 0x0, 
          input_z_layer = 0x0, state_z_layer = 0x0, input_r_layer = 0x0, state_r_layer = 0x0, input_h_layer = 0x0, state_h_layer = 0x0, wz = 0x0, uz = 0x0, wr = 0x0, ur = 0x0, wh = 0x0, 
          uh = 0x0, uo = 0x0, wo = 0x0, uf = 0x0, wf = 0x0, ui = 0x0, wi = 0x0, ug = 0x0, wg = 0x0, softmax_tree = 0x0, workspace_size = 1105920}
        delta = {w = 148, h = 189, c = 3, data = 0x55e481419b50}
        resized = {w = -2139878024, h = 21988, c = -2119842072, data = 0x55e481918228}
        out = {w = -2118441080, h = 21988, c = -2119970712, data = 0x55e48079ef48}
#8  0x000055e47e824f3c in run_nightmare (argc=<optimized out>, argv=<optimized out>) at ./examples/nightmare.c:383
        layer = 16
        octave = <optimized out>
        buff = "scream_jnet-conv_16_000000", '\000' <repeats 14 times>, "ศ„p\003\037\177\000\000\240\335\372\065\377\177\000\000\250Ip\003\001\000\000\000p\201p\003\037\177\000\000\220\335\372\065\377\177\000\000\335\f\200~\344U\000\000^\226\223\034\000\000\000\000\377\377\377\377\000\000\000\000\260\335\372\065\377\177\000\000\000C\240\002\037\177\000\000\200Sp\003\037\177\000\000\377\377\377\377\000\000\000\000|L\\t\000\000\000\000\220W\331\002\037\177\000\000\230Np\003\037\177\000\000\270\\\331\002\037\177\000\000\230Np\003\037\177\000\000\060\200\000\000\000\000\000\000\001\000\000\000\000\000\000\000@\341\372\065\377\177\000\000\220"...
        crop = {w = 352, h = 448, c = 3, data = 0x55e481797b80}
        resized = {w = 352, h = 448, c = 3, data = 0x55e481965b90}
        cfg = <optimized out>
        weights = <optimized out>
        input = <optimized out>
        range = 1
        norm = 1
        rounds = 30
        iters = 1
        octaves = 4
        zoom = 1
        rate = 0.0399999991
        thresh = 1
        rotate = 0
        momentum = 0.899999976
        lambda = 0.00999999978
        prefix = 0x0
        reconstruct = 0
        smooth_size = 1
        net = {n = 17, batch = 1, seen = 0x55e480714030, t = 0x55e480714050, epoch = 0, subdivisions = 1, layers = 0x55e4807239e0, output = 0x55e4813fbb40, policy = CONSTANT, 
          learning_rate = 0.00999999978, momentum = 0.899999976, decay = 0.000500000024, gamma = 0, scale = 0, power = 4, time_steps = 1, step = 0, max_batches = 0, scales = 0x0, 
          steps = 0x0, num_steps = 0, burn_in = 0, adam = 0, B1 = 0, B2 = 0, eps = 0, inputs = 83916, outputs = 30720, truths = 30720, notruth = 0, h = 189, w = 148, c = 3, max_crop = 20, 
          min_crop = 10, center = 0, angle = 0, aspect = 1, exposure = 1, saturation = 1, hue = 0, gpu_index = -1, hierarchy = 0x0, input = 0x55e481b33ba0, truth = 0x55e481505aa0, 
          delta = 0x55e481419b50, workspace = 0x7f1eeced8010, train = 0, index = 0, cost = 0x55e480714070}
        cfgbase = 0x55e480714240 "jnet-conv"
        imbase = 0x55e480714260 "scream"
        im = {w = 352, h = 448, c = 3, data = 0x55e481965b90}
        features = 0x0
        update = {w = 0, h = 0, c = 55516324, data = 0x1}
        e = 1
        n = 0
#9  0x000055e47e8286b3 in main (argc=10, argv=0x7fff35fae0e8) at ./examples/darknet.c:484
No locals.

Thread 2 (Thread 0x7f1ee4052700 (LWP 20302)):
#0  0x000055e47e85a555 in gemm_tn (M=<optimized out>, N=<optimized out>, K=<optimized out>, ALPHA=<optimized out>, A=<optimized out>, lda=<optimized out>, B=<optimized out>, ldb=-469426448, 
    C=0x0, ldc=0) at ./src/gemm.c:125
        A_PART = 0.0188630037
        i = 291
        j = 32767
        k = -2140035008
#1  0x00007f1f02fc68be in gomp_thread_start (xdata=<optimized out>) at ../../../src/libgomp/team.c:120
        team = 0x55e480717770
        task = 0x55e480717d80
        data = <optimized out>
        pool = <optimized out>
        local_fn = 0x55e47e85a453 <gemm_tn._omp_fn.2>
        local_data = 0x7fff35fac540
#2  0x00007f1f02d9a494 in start_thread (arg=0x7f1ee4052700) at pthread_create.c:333
        __res = <optimized out>
        pd = 0x7f1ee4052700
        now = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {139770651289344, 1786075862227522468, 0, 140734099015583, 0, 139771178414144, -1804638868751215708, -1803850822966930524}, 
              mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
        not_first_call = <optimized out>
        pagesize_m1 = <optimized out>
        sp = <optimized out>
        freesize = <optimized out>
        __PRETTY_FUNCTION__ = "start_thread"
#3  0x00007f1f02adca8f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
No locals.

Thread 1 (Thread 0x7f1ee3050700 (LWP 20304)):
#0  0x000055e47e85a544 in gemm_tn (M=<optimized out>, N=<optimized out>, K=<optimized out>, ALPHA=<optimized out>, A=<optimized out>, lda=<optimized out>, B=<optimized out>, ldb=0, C=0x0, 
    ldc=0) at ./src/gemm.c:126
        A_PART = -0.0280113202
        i = 865
        j = 32767
        k = -2140035008
#1  0x00007f1f02fc68be in gomp_thread_start (xdata=<optimized out>) at ../../../src/libgomp/team.c:120
        team = 0x55e480717770
        task = 0x55e480717f20
        data = <optimized out>
        pool = <optimized out>
        local_fn = 0x55e47e85a453 <gemm_tn._omp_fn.2>
        local_data = 0x7fff35fac540
#2  0x00007f1f02d9a494 in start_thread (arg=0x7f1ee3050700) at pthread_create.c:333
        __res = <optimized out>
        pd = 0x7f1ee3050700
        now = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {139770634503936, 1786075862227522468, 0, 140734099015583, 0, 139771178414144, -1804627879003647068, -1803850822966930524}, 
              mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
        not_first_call = <optimized out>
        pagesize_m1 = <optimized out>
        sp = <optimized out>
        freesize = <optimized out>
        __PRETTY_FUNCTION__ = "start_thread"
#3  0x00007f1f02adca8f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
No locals.

Invalid memory read and write for 'darknet detector demo'

Following command reveals several severe memory issues:
valgrind ./darknet -i 2 detector demo cfg/coco.data cfg/yolo.cfg weights/yolo.weights output.avi

I got similar output for several different video files.

==15657== Memcheck, a memory error detector
==15657== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==15657== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info
==15657== Command: ./darknet -i 2 detector demo cfg/coco.data cfg/yolo.cfg weights/yolo.weights /hri/rawstreams/CRR/eu/CARE/zbox1_eu_2017-06-30_140314/stream_offline/output.avi
==15657==
==15657== Warning: noted but unhandled ioctl 0x30000001 with no size/direction hints.
==15657== This could cause spurious value errors to appear.
==15657== See README_MISSING_SYSCALL_OR_IOCTL for guidance on writing a proper wrapper.
==15657== Warning: noted but unhandled ioctl 0x27 with no size/direction hints.
==15657== This could cause spurious value errors to appear.
==15657== See README_MISSING_SYSCALL_OR_IOCTL for guidance on writing a proper wrapper.
==15657== Warning: noted but unhandled ioctl 0x7ff with no size/direction hints.
==15657== This could cause spurious value errors to appear.
==15657== See README_MISSING_SYSCALL_OR_IOCTL for guidance on writing a proper wrapper.
==15657== Warning: noted but unhandled ioctl 0x25 with no size/direction hints.
==15657== This could cause spurious value errors to appear.
==15657== See README_MISSING_SYSCALL_OR_IOCTL for guidance on writing a proper wrapper.
==15657== Warning: noted but unhandled ioctl 0x17 with no size/direction hints.
==15657== This could cause spurious value errors to appear.
==15657== See README_MISSING_SYSCALL_OR_IOCTL for guidance on writing a proper wrapper.
==15657== Warning: set address range perms: large range [0x1000000000, 0x3100000000) (noaccess)
==15657== Warning: set address range perms: large range [0x3100000000, 0x3e00000000) (noaccess)
layer filters size input output
0 ==15657== Warning: noted but unhandled ioctl 0x19 with no size/direction hints.
==15657== This could cause spurious value errors to appear.
==15657== See README_MISSING_SYSCALL_OR_IOCTL for guidance on writing a proper wrapper.
==15657== Warning: noted but unhandled ioctl 0x21 with no size/direction hints.
==15657== This could cause spurious value errors to appear.
==15657== See README_MISSING_SYSCALL_OR_IOCTL for guidance on writing a proper wrapper.
==15657== Warning: noted but unhandled ioctl 0x1b with no size/direction hints.
==15657== This could cause spurious value errors to appear.
==15657== See README_MISSING_SYSCALL_OR_IOCTL for guidance on writing a proper wrapper.
conv 32 3 x 3 / 1 608 x 608 x 3 -> 608 x 608 x 32
1 max 2 x 2 / 2 608 x 608 x 32 -> 304 x 304 x 32
2 conv 64 3 x 3 / 1 304 x 304 x 32 -> 304 x 304 x 64
3 max 2 x 2 / 2 304 x 304 x 64 -> 152 x 152 x 64
4 conv 128 3 x 3 / 1 152 x 152 x 64 -> 152 x 152 x 128
5 conv 64 1 x 1 / 1 152 x 152 x 128 -> 152 x 152 x 64
6 conv 128 3 x 3 / 1 152 x 152 x 64 -> 152 x 152 x 128
7 max 2 x 2 / 2 152 x 152 x 128 -> 76 x 76 x 128
8 conv 256 3 x 3 / 1 76 x 76 x 128 -> 76 x 76 x 256
9 conv 128 1 x 1 / 1 76 x 76 x 256 -> 76 x 76 x 128
10 conv 256 3 x 3 / 1 76 x 76 x 128 -> 76 x 76 x 256
11 max 2 x 2 / 2 76 x 76 x 256 -> 38 x 38 x 256
12 conv 512 3 x 3 / 1 38 x 38 x 256 -> 38 x 38 x 512
13 conv 256 1 x 1 / 1 38 x 38 x 512 -> 38 x 38 x 256
14 conv 512 3 x 3 / 1 38 x 38 x 256 -> 38 x 38 x 512
15 conv 256 1 x 1 / 1 38 x 38 x 512 -> 38 x 38 x 256
16 conv 512 3 x 3 / 1 38 x 38 x 256 -> 38 x 38 x 512
17 max 2 x 2 / 2 38 x 38 x 512 -> 19 x 19 x 512
18 conv 1024 3 x 3 / 1 19 x 19 x 512 -> 19 x 19 x1024
19 conv 512 1 x 1 / 1 19 x 19 x1024 -> 19 x 19 x 512
20 conv 1024 3 x 3 / 1 19 x 19 x 512 -> 19 x 19 x1024
21 conv 512 1 x 1 / 1 19 x 19 x1024 -> 19 x 19 x 512
22 conv 1024 3 x 3 / 1 19 x 19 x 512 -> 19 x 19 x1024
23 conv 1024 3 x 3 / 1 19 x 19 x1024 -> 19 x 19 x1024
24 conv 1024 3 x 3 / 1 19 x 19 x1024 -> 19 x 19 x1024
25 route 16
26 conv 64 1 x 1 / 1 38 x 38 x 512 -> 38 x 38 x 64
27 reorg / 2 38 x 38 x 64 -> 19 x 19 x 256
28 route 27 24
29 conv 1024 3 x 3 / 1 19 x 19 x1280 -> 19 x 19 x1024
30 conv 425 1 x 1 / 1 19 x 19 x1024 -> 19 x 19 x 425
31 detection
Loading weights from weights/yolo.weights...Demo
Done!
==15657== Invalid write of size 4
==15657== at 0x4A5CDD: get_region_boxes (region_layer.c:404)
==15657== by 0x4925C4: detect_in_thread (demo.c:71)
==15657== by 0x492C75: demo (demo.c:151)
==15657== by 0x46DD45: run_detector (detector.c:702)
==15657== by 0x44D6D7: main (darknet.c:422)
==15657== Address 0x253307b0 is 0 bytes after a block of size 320 alloc'd
==15657== at 0x4C2CC70: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15657== by 0x492BD9: demo (demo.c:141)
==15657== by 0x46DD45: run_detector (detector.c:702)
==15657== by 0x44D6D7: main (darknet.c:422)
==15657==
==15657== Invalid read of size 4
==15657== at 0x458691: nms_comparator (box.c:243)
==15657== by 0x117FB294: msort_with_tmp.part.0 (msort.c:105)
==15657== by 0x117FB187: msort_with_tmp (msort.c:45)
==15657== by 0x117FB187: msort_with_tmp.part.0 (msort.c:54)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== Address 0x3e872980 is 0 bytes after a block of size 320 alloc'd
==15657== at 0x4C2CC70: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15657== by 0x492BD9: demo (demo.c:141)
==15657== by 0x46DD45: run_detector (detector.c:702)
==15657== by 0x44D6D7: main (darknet.c:422)
==15657==
==15657== Invalid read of size 4
==15657== at 0x4586B6: nms_comparator (box.c:243)
==15657== by 0x117FB294: msort_with_tmp.part.0 (msort.c:105)
==15657== by 0x117FB187: msort_with_tmp (msort.c:45)
==15657== by 0x117FB187: msort_with_tmp.part.0 (msort.c:54)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== Address 0x357dc670 is 0 bytes after a block of size 320 alloc'd
==15657== at 0x4C2CC70: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15657== by 0x492BD9: demo (demo.c:141)
==15657== by 0x46DD45: run_detector (detector.c:702)
==15657== by 0x44D6D7: main (darknet.c:422)
==15657==
==15657== Invalid read of size 4
==15657== at 0x458691: nms_comparator (box.c:243)
==15657== by 0x117FB294: msort_with_tmp.part.0 (msort.c:105)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB6CB: msort_with_tmp (msort.c:45)
==15657== by 0x117FB6CB: qsort_r (msort.c:297)
==15657== Address 0x253307b0 is 0 bytes after a block of size 320 alloc'd
==15657== at 0x4C2CC70: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15657== by 0x492BD9: demo (demo.c:141)
==15657== by 0x46DD45: run_detector (detector.c:702)
==15657== by 0x44D6D7: main (darknet.c:422)
==15657==
==15657== Invalid read of size 4
==15657== at 0x4586B6: nms_comparator (box.c:243)
==15657== by 0x117FB294: msort_with_tmp.part.0 (msort.c:105)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB6CB: msort_with_tmp (msort.c:45)
==15657== by 0x117FB6CB: qsort_r (msort.c:297)
==15657== Address 0x3e872980 is 0 bytes after a block of size 320 alloc'd
==15657== at 0x4C2CC70: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15657== by 0x492BD9: demo (demo.c:141)
==15657== by 0x46DD45: run_detector (detector.c:702)
==15657== by 0x44D6D7: main (darknet.c:422)
==15657==
==15657== Invalid read of size 4
==15657== at 0x458691: nms_comparator (box.c:243)
==15657== by 0x117FB294: msort_with_tmp.part.0 (msort.c:105)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB187: msort_with_tmp (msort.c:45)
==15657== by 0x117FB187: msort_with_tmp.part.0 (msort.c:54)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== Address 0x3e6ba140 is 0 bytes after a block of size 320 alloc'd
==15657== at 0x4C2CC70: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15657== by 0x492BD9: demo (demo.c:141)
==15657== by 0x46DD45: run_detector (detector.c:702)
==15657== by 0x44D6D7: main (darknet.c:422)
==15657==
==15657== Invalid read of size 4
==15657== at 0x4586B6: nms_comparator (box.c:243)
==15657== by 0x117FB294: msort_with_tmp.part.0 (msort.c:105)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB187: msort_with_tmp (msort.c:45)
==15657== by 0x117FB187: msort_with_tmp.part.0 (msort.c:54)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== Address 0x3e9c5080 is 0 bytes after a block of size 320 alloc'd
==15657== at 0x4C2CC70: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15657== by 0x492BD9: demo (demo.c:141)
==15657== by 0x46DD45: run_detector (detector.c:702)
==15657== by 0x44D6D7: main (darknet.c:422)
==15657==
==15657== Invalid read of size 4
==15657== at 0x458691: nms_comparator (box.c:243)
==15657== by 0x117FB294: msort_with_tmp.part.0 (msort.c:105)
==15657== by 0x117FB187: msort_with_tmp (msort.c:45)
==15657== by 0x117FB187: msort_with_tmp.part.0 (msort.c:54)
==15657== by 0x117FB187: msort_with_tmp (msort.c:45)
==15657== by 0x117FB187: msort_with_tmp.part.0 (msort.c:54)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== Address 0x3dad7640 is 0 bytes after a block of size 320 alloc'd
==15657== at 0x4C2CC70: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15657== by 0x492BD9: demo (demo.c:141)
==15657== by 0x46DD45: run_detector (detector.c:702)
==15657== by 0x44D6D7: main (darknet.c:422)
==15657==
==15657== Invalid read of size 4
==15657== at 0x4586B6: nms_comparator (box.c:243)
==15657== by 0x117FB294: msort_with_tmp.part.0 (msort.c:105)
==15657== by 0x117FB187: msort_with_tmp (msort.c:45)
==15657== by 0x117FB187: msort_with_tmp.part.0 (msort.c:54)
==15657== by 0x117FB187: msort_with_tmp (msort.c:45)
==15657== by 0x117FB187: msort_with_tmp.part.0 (msort.c:54)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== Address 0x35812830 is 0 bytes after a block of size 320 alloc'd
==15657== at 0x4C2CC70: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15657== by 0x492BD9: demo (demo.c:141)
==15657== by 0x46DD45: run_detector (detector.c:702)
==15657== by 0x44D6D7: main (darknet.c:422)
==15657==
==15657== Invalid read of size 4
==15657== at 0x458691: nms_comparator (box.c:243)
==15657== by 0x117FB294: msort_with_tmp.part.0 (msort.c:105)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB6CB: msort_with_tmp (msort.c:45)
==15657== by 0x117FB6CB: qsort_r (msort.c:297)
==15657== by 0x45879B: do_nms_obj (box.c:260)
==15657== by 0x492625: detect_in_thread (demo.c:75)
==15657== by 0x492C75: demo (demo.c:151)
==15657== by 0x46DD45: run_detector (detector.c:702)
==15657== by 0x44D6D7: main (darknet.c:422)
==15657== Address 0x3e9103a0 is 0 bytes after a block of size 320 alloc'd
==15657== at 0x4C2CC70: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15657== by 0x492BD9: demo (demo.c:141)
==15657== by 0x46DD45: run_detector (detector.c:702)
==15657== by 0x44D6D7: main (darknet.c:422)
==15657==
==15657== Invalid read of size 4
==15657== at 0x4586B6: nms_comparator (box.c:243)
==15657== by 0x117FB294: msort_with_tmp.part.0 (msort.c:105)
==15657== by 0x117FB171: msort_with_tmp (msort.c:45)
==15657== by 0x117FB171: msort_with_tmp.part.0 (msort.c:53)
==15657== by 0x117FB6CB: msort_with_tmp (msort.c:45)
==15657== by 0x117FB6CB: qsort_r (msort.c:297)
==15657== by 0x45879B: do_nms_obj (box.c:260)
==15657== by 0x492625: detect_in_thread (demo.c:75)
==15657== by 0x492C75: demo (demo.c:151)
==15657== by 0x46DD45: run_detector (detector.c:702)
==15657== by 0x44D6D7: main (darknet.c:422)
==15657== Address 0x3fdf50d0 is 0 bytes after a block of size 320 alloc'd
==15657== at 0x4C2CC70: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15657== by 0x492BD9: demo (demo.c:141)
==15657== by 0x46DD45: run_detector (detector.c:702)
==15657== by 0x44D6D7: main (darknet.c:422)
==15657==
==15657== Invalid read of size 4
==15657== at 0x458691: nms_comparator (box.c:243)
==15657== by 0x117FB294: msort_with_tmp.part.0 (msort.c:105)
==15657== by 0x117FB187: msort_with_tmp (msort.c:45)
==15657== by 0x117FB187: msort_with_tmp.part.0 (msort.c:54)
==15657== by 0x117FB6CB: msort_with_tmp (msort.c:45)
==15657== by 0x117FB6CB: qsort_r (msort.c:297)
==15657== by 0x45879B: do_nms_obj (box.c:260)
==15657== by 0x492625: detect_in_thread (demo.c:75)
==15657== by 0x492C75: demo (demo.c:151)
==15657== by 0x46DD45: run_detector (detector.c:702)
==15657== by 0x44D6D7: main (darknet.c:422)
==15657== Address 0x59c5fee0 is 0 bytes after a block of size 320 alloc'd
==15657== at 0x4C2CC70: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15657== by 0x492BD9: demo (demo.c:141)
==15657== by 0x46DD45: run_detector (detector.c:702)
==15657== by 0x44D6D7: main (darknet.c:422)
==15657==
==15657== Invalid read of size 4
==15657== at 0x4586B6: nms_comparator (box.c:243)
==15657== by 0x117FB294: msort_with_tmp.part.0 (msort.c:105)
==15657== by 0x117FB187: msort_with_tmp (msort.c:45)
==15657== by 0x117FB187: msort_with_tmp.part.0 (msort.c:54)
==15657== by 0x117FB6CB: msort_with_tmp (msort.c:45)
==15657== by 0x117FB6CB: qsort_r (msort.c:297)
==15657== by 0x45879B: do_nms_obj (box.c:260)
==15657== by 0x492625: detect_in_thread (demo.c:75)
==15657== by 0x492C75: demo (demo.c:151)
==15657== by 0x46DD45: run_detector (detector.c:702)
==15657== by 0x44D6D7: main (darknet.c:422)
==15657== Address 0x3e839a80 is 0 bytes after a block of size 320 alloc'd
==15657== at 0x4C2CC70: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15657== by 0x492BD9: demo (demo.c:141)
==15657== by 0x46DD45: run_detector (detector.c:702)
==15657== by 0x44D6D7: main (darknet.c:422)
==15657==
==15657== Invalid read of size 4
==15657== at 0x458691: nms_comparator (box.c:243)
==15657== by 0x117FB294: msort_with_tmp.part.0 (msort.c:105)
==15657== by 0x117FB6CB: msort_with_tmp (msort.c:45)
==15657== by 0x117FB6CB: qsort_r (msort.c:297)
==15657== by 0x45879B: do_nms_obj (box.c:260)
==15657== by 0x492625: detect_in_thread (demo.c:75)
==15657== by 0x492C75: demo (demo.c:151)
==15657== by 0x46DD45: run_detector (detector.c:702)
==15657== by 0x44D6D7: main (darknet.c:422)
==15657== Address 0x3fdf50d0 is 0 bytes after a block of size 320 alloc'd
==15657== at 0x4C2CC70: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15657== by 0x492BD9: demo (demo.c:141)
==15657== by 0x46DD45: run_detector (detector.c:702)
==15657== by 0x44D6D7: main (darknet.c:422)
==15657==
==15657== Invalid read of size 4
==15657== at 0x4586B6: nms_comparator (box.c:243)
==15657== by 0x117FB294: msort_with_tmp.part.0 (msort.c:105)
==15657== by 0x117FB6CB: msort_with_tmp (msort.c:45)
==15657== by 0x117FB6CB: qsort_r (msort.c:297)
==15657== by 0x45879B: do_nms_obj (box.c:260)
==15657== by 0x492625: detect_in_thread (demo.c:75)
==15657== by 0x492C75: demo (demo.c:151)
==15657== by 0x46DD45: run_detector (detector.c:702)
==15657== by 0x44D6D7: main (darknet.c:422)
==15657== Address 0x59c5fee0 is 0 bytes after a block of size 320 alloc'd
==15657== at 0x4C2CC70: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15657== by 0x492BD9: demo (demo.c:141)
==15657== by 0x46DD45: run_detector (detector.c:702)
==15657== by 0x44D6D7: main (darknet.c:422)
==15657==
==15657== Invalid read of size 4
==15657== at 0x4587DE: do_nms_obj (box.c:262)
==15657== by 0x492625: detect_in_thread (demo.c:75)
==15657== by 0x492C75: demo (demo.c:151)
==15657== by 0x46DD45: run_detector (detector.c:702)
==15657== by 0x44D6D7: main (darknet.c:422)
==15657== Address 0x59c5fee0 is 0 bytes after a block of size 320 alloc'd
==15657== at 0x4C2CC70: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15657== by 0x492BD9: demo (demo.c:141)
==15657== by 0x46DD45: run_detector (detector.c:702)
==15657== by 0x44D6D7: main (darknet.c:422)
==15657==
==15657== Invalid write of size 4
==15657== at 0x4588F0: do_nms_obj (box.c:268)
==15657== by 0x492625: detect_in_thread (demo.c:75)
==15657== by 0x492C75: demo (demo.c:151)
==15657== by 0x46DD45: run_detector (detector.c:702)
==15657== by 0x44D6D7: main (darknet.c:422)
==15657== Address 0x59c61b60 is 0 bytes after a block of size 320 alloc'd
==15657== at 0x4C2CC70: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15657== by 0x492BD9: demo (demo.c:141)
==15657== by 0x46DD45: run_detector (detector.c:702)
==15657== by 0x44D6D7: main (darknet.c:422)
==15657==
==15657== Invalid write of size 4
==15657== at 0x4A5CDD: get_region_boxes (region_layer.c:404)
==15657== by 0x4925C4: detect_in_thread (demo.c:71)
==15657== by 0x492D16: demo (demo.c:158)
==15657== by 0x46DD45: run_detector (detector.c:702)
==15657== by 0x44D6D7: main (darknet.c:422)
==15657== Address 0x253307b0 is 0 bytes after a block of size 320 alloc'd
==15657== at 0x4C2CC70: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15657== by 0x492BD9: demo (demo.c:141)
==15657== by 0x46DD45: run_detector (detector.c:702)
==15657== by 0x44D6D7: main (darknet.c:422)
==15657==
==15657== Invalid read of size 4
==15657== at 0x4587DE: do_nms_obj (box.c:262)
==15657== by 0x492625: detect_in_thread (demo.c:75)
==15657== by 0x492D16: demo (demo.c:158)
==15657== by 0x46DD45: run_detector (detector.c:702)
==15657== by 0x44D6D7: main (darknet.c:422)
==15657== Address 0x3e9a32f0 is 0 bytes after a block of size 320 alloc'd
==15657== at 0x4C2CC70: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15657== by 0x492BD9: demo (demo.c:141)
==15657== by 0x46DD45: run_detector (detector.c:702)
==15657== by 0x44D6D7: main (darknet.c:422)
==15657==
==15657== Invalid write of size 4
==15657== at 0x4588F0: do_nms_obj (box.c:268)
==15657== by 0x492625: detect_in_thread (demo.c:75)
==15657== by 0x492D16: demo (demo.c:158)
==15657== by 0x46DD45: run_detector (detector.c:702)
==15657== by 0x44D6D7: main (darknet.c:422)
==15657== Address 0x59c61b60 is 0 bytes after a block of size 320 alloc'd
==15657== at 0x4C2CC70: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15657== by 0x492BD9: demo (demo.c:141)
==15657== by 0x46DD45: run_detector (detector.c:702)
==15657== by 0x44D6D7: main (darknet.c:422)
==15657==
==15657== Thread 7:
==15657== Invalid write of size 4
==15657== at 0x4A5CDD: get_region_boxes (region_layer.c:404)
==15657== by 0x4925C4: detect_in_thread (demo.c:71)
==15657== by 0x115AA183: start_thread (pthread_create.c:312)
==15657== by 0x118BDFFC: clone (clone.S:111)
==15657== Address 0x253307b0 is 0 bytes after a block of size 320 alloc'd
==15657== at 0x4C2CC70: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15657== by 0x492BD9: demo (demo.c:141)
==15657== by 0x46DD45: run_detector (detector.c:702)
==15657== by 0x44D6D7: main (darknet.c:422)
==15657==
==15657== Invalid read of size 4
==15657== at 0x4587DE: do_nms_obj (box.c:262)
==15657== by 0x492625: detect_in_thread (demo.c:75)
==15657== by 0x115AA183: start_thread (pthread_create.c:312)
==15657== by 0x118BDFFC: clone (clone.S:111)
==15657== Address 0x3e9a32f0 is 0 bytes after a block of size 320 alloc'd
==15657== at 0x4C2CC70: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15657== by 0x492BD9: demo (demo.c:141)
==15657== by 0x46DD45: run_detector (detector.c:702)
==15657== by 0x44D6D7: main (darknet.c:422)
==15657==
==15657== Invalid write of size 4
==15657== at 0x4588F0: do_nms_obj (box.c:268)
==15657== by 0x492625: detect_in_thread (demo.c:75)
==15657== by 0x115AA183: start_thread (pthread_create.c:312)
==15657== by 0x118BDFFC: clone (clone.S:111)
==15657== Address 0x59c61e60 is 0 bytes after a block of size 320 alloc'd
==15657== at 0x4C2CC70: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15657== by 0x492BD9: demo (demo.c:141)
==15657== by 0x46DD45: run_detector (detector.c:702)
==15657== by 0x44D6D7: main (darknet.c:422)
==15657==
video file: /hri/rawstreams/CRR/eu/CARE/zbox1_eu_2017-06-30_140314/stream_offline/output.avi
๏ฟฝ[2J๏ฟฝ[1;1H
FPS:0.0
Objects:

๏ฟฝ[2J๏ฟฝ[1;1H
FPS:0.0
Objects:

๏ฟฝ[2J๏ฟฝ[1;1H
FPS:0.0
Objects:

๏ฟฝ[2J๏ฟฝ[1;1H
FPS:0.1
Objects:

bottle: 38%
๏ฟฝ[2J๏ฟฝ[1;1H
FPS:0.1
Objects:

bottle: 39%
==15657==
==15657== HEAP SUMMARY:
==15657== in use at exit: 1,417,439,660 bytes in 174,375 blocks
==15657== total heap usage: 272,296 allocs, 97,921 frees, 1,815,194,098 bytes allocated
==15657==
==15657== LEAK SUMMARY:
==15657== definitely lost: 91,500 bytes in 3 blocks
==15657== indirectly lost: 0 bytes in 0 blocks
==15657== possibly lost: 10,385,823 bytes in 7,710 blocks
==15657== still reachable: 1,406,930,921 bytes in 166,472 blocks
==15657== suppressed: 0 bytes in 0 blocks
==15657== Rerun with --leak-check=full to see details of leaked memory
==15657==
==15657== For counts of detected and suppressed errors, rerun with: -v
==15657== ERROR SUMMARY: 187227 errors from 23 contexts (suppressed: 1 from 1)

The speed varies greatly

Hi~ Your code is AMAZING !

I cloned your code at Jan 2017 ( the OLD version), and Aug 2017(the NEW version). I just noticed that the OLD version is faster than the NEW version.

The following is a comparison(without IO time):

GPU NEW OLD -
Titan X 0.032363ms/pic 0.020797ms/pic ~ 35% faster
K40 0.072557ms/pic 0.05184ms/pic ~ 28% faster

The compile args/ cfg files/ weights files are same.

GPU=1
CUDNN=1
OPENCV=0
DEBUG=0

ARCH= -gencode arch=compute_30,code=sm_30 \
      -gencode arch=compute_35,code=sm_35 \
      -gencode arch=compute_50,code=[sm_50,compute_50] \
      -gencode arch=compute_52,code=[sm_52,compute_52] \
      -gencode arch=compute_60,code=sm_60 \
      -gencode arch=compute_61,code=sm_61 \
      -gencode arch=compute_61,code=compute_61

So.. can you tell me why?

Getting make error while compiling with cuDNN

screenshot from 2017-07-18 01_08_17
Hi, I've compiled darknet successfully with GPU=1 flag, but its running at 0.5-1.5 FPS. I have installed CUDA 8.0 and have tried compiling with cuDNN v4.0, v5.0 and v6.0 as well but I'm getting the above error. Any help appreciated!

parallizing using OpenMP problem

I clone the code at 2017/07/17 and compiled for windows 64bit using @AlexeyAB 's porting method.
The darknet works fine without OpenMP option,if compiled with OpenMP ,the program will have memory access problem sometimes.

Python implementation

I see you have used ctypes for having python extension to the code.

When I try to run it however, it says:

Couldn't open file: data/coco.names

Any leads on this? Also does it still run on GPU with python? ver: 2 or 3?

How to set anchors in cfg file ?

l.biases in region_layer.c shoule be replaced by:
l.biased[i2+0]=l.biased[i2+0]/l.w
l.biased[i2+1]=l.biased[i2+1]/l.h
because in file :detetor.c,random dim be used:
int dim = (rand() % 10 + 10) * 32;
of course ,anchor params be changed according

Enhancement idea: SQL lite mgmt of training images

Hi -
Darknet/YOLOv2 is great!!
We've trained it on a number of datasets, with really good results.

When managing a large number of images, it would be great to have an option to move beyond pathname indicators for referencing files (in train.txt and test.txt).

Any thoughts on using a light database approach to managing files (like NoSQL or SQL-lite)? Could make managing even larger datasets easier.

Thanks again for an awesome framework!
Rob

Training on multiple GPUs - iteration number is not sequentially

Hi
When i train on multiple gpus -gpus 0,1,2,3 i see that the iteration number rise not sequentially and there for backup every 100,1000 or 10000 doesn't happen. it misses the %1000==0

Thanks

Region Avg IOU: 0.454094, Class: 0.539861, Obj: 0.114575, No Obj: 0.006711, Avg Recall: 0.509091,  count: 55
5535: 30.146860, 29.296202 avg, 0.004000 rate, 62.480057 seconds, 1416960 images
Loaded: 0.000303 seconds
Region Avg IOU: 0.362384, Class: 0.510273, Obj: 0.159985, No Obj: 0.008064, Avg Recall: 0.333333,  count: 75
Region Avg IOU: 0.382254, Class: 0.569780, Obj: 0.187762, No Obj: 0.006942, Avg Recall: 0.405405,  count: 37
Region Avg IOU: 0.293618, Class: 0.329098, Obj: 0.172438, No Obj: 0.008295, Avg Recall: 0.342466,  count: 73
Region Avg IOU: 0.430122, Class: 0.630054, Obj: 0.095643, No Obj: 0.005807, Avg Recall: 0.472222,  count: 36
Region Avg IOU: 0.293003, Class: 0.374357, Obj: 0.139664, No Obj: 0.007799, Avg Recall: 0.246575,  count: 73
Region Avg IOU: 0.416864, Class: 0.227515, Obj: 0.113475, No Obj: 0.006115, Avg Recall: 0.487805,  count: 41
Region Avg IOU: 0.555408, Class: 0.554738, Obj: 0.226879, No Obj: 0.007803, Avg Recall: 0.588235,  count: 17
Region Avg IOU: 0.459013, Class: 0.381784, Obj: 0.193288, No Obj: 0.005824, Avg Recall: 0.580645,  count: 31
Region Avg IOU: 0.589257, Class: 0.380691, Obj: 0.230529, No Obj: 0.007240, Avg Recall: 0.666667,  count: 24
Region Avg IOU: 0.391813, Class: 0.417314, Obj: 0.187585, No Obj: 0.007195, Avg Recall: 0.423077,  count: 52
Region Avg IOU: 0.513660, Class: 0.592106, Obj: 0.166535, No Obj: 0.008167, Avg Recall: 0.589744,  count: 39
Region Avg IOU: 0.378107, Class: 0.282193, Obj: 0.098436, No Obj: 0.006287, Avg Recall: 0.375000,  count: 80
Region Avg IOU: 0.385749, Class: 0.187662, Obj: 0.083863, No Obj: 0.008231, Avg Recall: 0.340000,  count: 50
Region Avg IOU: 0.279301, Class: 0.319146, Obj: 0.152392, No Obj: 0.006699, Avg Recall: 0.217391,  count: 69
Region Avg IOU: 0.408984, Class: 0.460680, Obj: 0.156198, No Obj: 0.007666, Avg Recall: 0.418182,  count: 55
Region Avg IOU: 0.339951, Class: 0.403575, Obj: 0.103020, No Obj: 0.007019, Avg Recall: 0.300000,  count: 110
Region Avg IOU: 0.319821, Class: 0.446927, Obj: 0.103471, No Obj: 0.007668, Avg Recall: 0.379310,  count: 58
Region Avg IOU: 0.518152, Class: 0.575077, Obj: 0.140920, No Obj: 0.008971, Avg Recall: 0.573529,  count: 68
Region Avg IOU: 0.492652, Class: 0.583876, Obj: 0.201243, No Obj: 0.009499, Avg Recall: 0.600000,  count: 45
Region Avg IOU: 0.583092, Class: 0.472818, Obj: 0.266019, No Obj: 0.008068, Avg Recall: 0.700000,  count: 20
Region Avg IOU: 0.408801, Class: 0.391544, Obj: 0.161156, No Obj: 0.006466, Avg Recall: 0.381818,  count: 55
Region Avg IOU: 0.440448, Class: 0.384089, Obj: 0.223808, No Obj: 0.007991, Avg Recall: 0.484848,  count: 33
Region Avg IOU: 0.535046, Class: 0.424881, Obj: 0.136086, No Obj: 0.007484, Avg Recall: 0.617647,  count: 34
Region Avg IOU: 0.518109, Class: 0.599688, Obj: 0.150311, No Obj: 0.007573, Avg Recall: 0.621622,  count: 37
Region Avg IOU: 0.433767, Class: 0.374441, Obj: 0.200943, No Obj: 0.008492, Avg Recall: 0.531915,  count: 47
Region Avg IOU: 0.517354, Class: 0.553782, Obj: 0.171961, No Obj: 0.008288, Avg Recall: 0.591837,  count: 49
Region Avg IOU: 0.620490, Class: 0.471173, Obj: 0.196483, No Obj: 0.008271, Avg Recall: 0.714286,  count: 14
Region Avg IOU: 0.347727, Class: 0.449756, Obj: 0.143466, No Obj: 0.007169, Avg Recall: 0.345455,  count: 55
Region Avg IOU: 0.397453, Class: 0.389798, Obj: 0.112621, No Obj: 0.006925, Avg Recall: 0.390625,  count: 64
Region Avg IOU: 0.422600, Class: 0.556410, Obj: 0.153910, No Obj: 0.007374, Avg Recall: 0.465116,  count: 43
Region Avg IOU: 0.292901, Class: 0.307642, Obj: 0.103662, No Obj: 0.006220, Avg Recall: 0.266667,  count: 45
Region Avg IOU: 0.445993, Class: 0.462168, Obj: 0.168339, No Obj: 0.007389, Avg Recall: 0.438596,  count: 57
Syncing... Done!
5548: 34.672623, 29.833843 avg, 0.004000 rate, 67.664970 seconds, 1420288 images
Loaded: 0.000039 seconds
Region Avg IOU: 0.500222, Class: 0.576081, Obj: 0.257318, No Obj: 0.007791, Avg Recall: 0.521739,  count: 23

Segmentation fault in get_region_box

I am using darknet to train a face detector on the WIDER dataset (formatted correctly for Darknet).

I get to step ~140-150 before I start seeing a segmentation fault pop up.

System info

gdb -ex=r --args ./darknet detector train ./cfg/face/train.data ./cfg/face/yolo-face.2.0.train.cfg ./backup/yolo-face.backup -gpus 0 # I was able to get to at least 100 iterations, hence the ./backup/yolo-face.backup file

Description

When I try to train the dataset, I get a segmentation fault in ./src/region_layer.c:79, which is the get_region_box function.

To debug this, I just put in some logging statements and found that at the moment the segfault appears, the index, i, and j parameters are suddenly massively increased:

stride=169, index=35658, i=12, j=12, w=13, h=13
stride=169, index=35658, i=12, j=12, w=13, h=13
stride=169, index=36672, i=12, j=12, w=13, h=13
stride=169, index=36672, i=12, j=12, w=13, h=13
stride=169, index=37686, i=12, j=12, w=13, h=13
stride=169, index=37686, i=12, j=12, w=13, h=13
stride=169, index=38700, i=12, j=12, w=13, h=13
stride=169, index=38700, i=12, j=12, w=13, h=13
stride=169, index=39714, i=12, j=12, w=13, h=13
stride=169, index=39714, i=12, j=12, w=13, h=13
stride=169, index=1092034398, i=12999987, j=12999987, w=13, h=13

heap-buffer-overflow in stbi__tga_load

Hi.

I found a heap-buffer-overflow bug in Darknet.

Please confirm.

Thanks.

Summary: heap-buffer-overflow
OS: Ubuntu 16.04 32bit
Steps to reproduce:
1.Download the .POC files.
2.Compile the source code with ASan.
3.Execute the following command
: ./darknet imtest $PoC
PoC download : PoC

=================================================================
==17442==ERROR: AddressSanitizer: heap-buffer-overflow on address 0xb59007d1 at pc 0x08103875 bp 0xbf91cae8 sp 0xbf91c6c0
READ of size 2 at 0xb59007d1 thread T0
    #0 0x8103874 in __asan_memcpy (/root/karas/darknet/darknet+0x8103874)
    #1 0x827db7b in stbi__tga_load /root/karas/darknet/src/stb_image.h:4970:31
    #2 0x827db7b in stbi__load_main /root/karas/darknet/src/stb_image.h:961
    #3 0x8201cfb in stbi__load_flip /root/karas/darknet/src/stb_image.h:969:28
    #4 0x8201cfb in stbi_load_from_file /root/karas/darknet/src/stb_image.h:1044
    #5 0x8246cb3 in stbi_load /root/karas/darknet/src/stb_image.h:1034:13
    #6 0x8246cb3 in load_image_stb /root/karas/darknet/./src/image.c:1371
    #7 0x8245815 in load_image /root/karas/darknet/./src/image.c:1397:17
    #8 0x8245815 in test_resize /root/karas/darknet/./src/image.c:1320
    #9 0x81e9766 in main /root/karas/darknet/./examples/darknet.c:476:9
    #10 0xb7506636 in __libc_start_main /build/glibc-KM3i_a/glibc-2.23/csu/../csu/libc-start.c:291
    #11 0x8067e27 in _start (/root/karas/darknet/darknet+0x8067e27)

0xb59007d1 is located 0 bytes to the right of 1-byte region [0xb59007d0,0xb59007d1)
allocated by thread T0 here:
    #0 0x811b514 in malloc (/root/karas/darknet/darknet+0x811b514)
    #1 0x8277d91 in stbi__malloc /root/karas/darknet/src/stb_image.h:889:12
    #2 0x8277d91 in stbi__tga_load /root/karas/darknet/src/stb_image.h:4922
    #3 0x8277d91 in stbi__load_main /root/karas/darknet/src/stb_image.h:961
    #4 0x8201cfb in stbi__load_flip /root/karas/darknet/src/stb_image.h:969:28
    #5 0x8201cfb in stbi_load_from_file /root/karas/darknet/src/stb_image.h:1044
    #6 0x8246cb3 in stbi_load /root/karas/darknet/src/stb_image.h:1034:13
    #7 0x8246cb3 in load_image_stb /root/karas/darknet/./src/image.c:1371
    #8 0x8245815 in load_image /root/karas/darknet/./src/image.c:1397:17
    #9 0x8245815 in test_resize /root/karas/darknet/./src/image.c:1320
    #10 0x81e9766 in main /root/karas/darknet/./examples/darknet.c:476:9
    #11 0xb7506636 in __libc_start_main /build/glibc-KM3i_a/glibc-2.23/csu/../csu/libc-start.c:291

SUMMARY: AddressSanitizer: heap-buffer-overflow (/root/karas/darknet/darknet+0x8103874) in __asan_memcpy
Shadow bytes around the buggy address:
  0x36b200a0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x36b200b0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x36b200c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x36b200d0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x36b200e0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
=>0x36b200f0: fa fa fa fa fa fa fa fa fa fa[01]fa fa fa 01 fa
  0x36b20100: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x36b20110: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x36b20120: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x36b20130: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x36b20140: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Heap right redzone:      fb
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack partial redzone:   f4
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
==17442==ABORTING

Segmentation fault in load_image_cv() when training darknet

I check that the file exists and cvLoadImage() run successfully and the IplImage ptr 'src' is not null. But when i access to src->height or any other member variables in src, it crashs and show error below:

   25 route  16
   26 reorg              / 2    40 x  30 x 512   ->    20 x  15 x2048
   27 route  26 24
   28 conv   1024  3 x 3 / 1    20 x  15 x3072   ->    20 x  15 x1024
   29 conv     30  1 x 1 / 1    20 x  15 x1024   ->    20 x  15 x  30
   30 detection
mask_scale: Using default '1.000000'
Learning Rate: 0.0001, Momentum: 0.9, Decay: 0.0005
Segmentation fault (core dumped)

However, if i turn off OPENCV in Makefile, it seems OK. What's wrong with the load_image_cv()?

the code:

image load_image_cv(char *filename, int channels)
{
    IplImage* src = 0;
    int flag = -1;
    if (channels == 0) flag = -1;
    else if (channels == 1) flag = 0;
    else if (channels == 3) flag = 1;
    else {
        fprintf(stderr, "OpenCV can't force load with %d channels\n", channels);
    }

    if( (src = cvLoadImage(filename, flag)) == 0 )
    {
        fprintf(stderr, "Cannot load image \"%s\"\n", filename);
        char buff[256];
        sprintf(buff, "echo %s >> bad.list", filename);
        system(buff);
        return make_image(10,10,3);
        //exit(0);
    }
    image out = ipl_to_image(src);
    cvReleaseImage(&src);
    rgbgr_image(out);
    return out;
}

Replace use of sizeof() in file import/export code with explicit byte count

Currently the binary layout of the weights files (and possibly other files) is defined using sizeof(int) and sizeof(size_t) which aren't guaranteed to be specific numbers across platforms. While sizeof(int) is most likely 4 bytes on any machine that Darknet is built for today, sizeof(size_t) can be either 4 or 8 bytes simply depending on whether the compiler is invoked with -m32 or -m64.

A binary file format should definitely be predictable, but unfortunately anyone who downloads the pre-trained weights files and attempts to run Darknet on a machine with a different build config than the author's will likely experience unexplainable behavior.

corrupted size vs. prev_size

I am running yolo training on darknet. I am stuck with this error. Please help.

workspace size 21233664 *** Error in ./darknet': corrupted size vs. prev_size: 0x0000000001622c50 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f8e7b7dd7e5]
/lib/x86_64-linux-gnu/libc.so.6(+0x7e9dc)[0x7f8e7b7e49dc]
/lib/x86_64-linux-gnu/libc.so.6(+0x81cde)[0x7f8e7b7e7cde]
/lib/x86_64-linux-gnu/libc.so.6(__libc_malloc+0x54)[0x7f8e7b7ea184]
/lib/x86_64-linux-gnu/libc.so.6(_IO_file_doallocate+0x55)[0x7f8e7b7d31d5]
/lib/x86_64-linux-gnu/libc.so.6(_IO_doallocbuf+0x34)[0x7f8e7b7e1594]
/lib/x86_64-linux-gnu/libc.so.6(_IO_file_underflow+0x1fc)[0x7f8e7b7e069c]
/lib/x86_64-linux-gnu/libc.so.6(_IO_default_uflow+0xe)[0x7f8e7b7e160e]
/lib/x86_64-linux-gnu/libc.so.6(_IO_getline_info+0xaa)[0x7f8e7b7d4c6a]
/lib/x86_64-linux-gnu/libc.so.6(fgets+0xad)[0x7f8e7b7d3b7d]
/usr/lib/x86_64-linux-gnu/libcuda.so.1(+0x1bece2)[0x7f8e815bace2]
/usr/lib/x86_64-linux-gnu/libcuda.so.1(+0x1bf986)[0x7f8e815bb986]
/usr/lib/x86_64-linux-gnu/libcuda.so.1(+0x26a14d)[0x7f8e8166614d]
/usr/lib/x86_64-linux-gnu/libcuda.so.1(+0x274cc5)[0x7f8e81670cc5]
/usr/lib/x86_64-linux-gnu/libcuda.so.1(+0x2750ea)[0x7f8e816710ea]
/usr/lib/x86_64-linux-gnu/libcuda.so.1(+0xbf4cb)[0x7f8e814bb4cb]
/usr/lib/x86_64-linux-gnu/libcuda.so.1(+0xbfe12)[0x7f8e814bbe12]
/usr/lib/x86_64-linux-gnu/libcuda.so.1(cuMemAlloc_v2+0x5d)[0x7f8e815e47ad]
/home/madan/cuda7/lib64/libcudart.so.7.5(+0x2ca13)[0x7f8e811caa13]
/home/madan/cuda7/lib64/libcudart.so.7.5(+0x11ffe)[0x7f8e811afffe]
/home/madan/cuda7/lib64/libcudart.so.7.5(cudaMalloc+0x6c)[0x7f8e811dacac]
./darknet[0x40a5b0]
./darknet[0x4435c1]
./darknet[0x45492f]
./darknet[0x4567f7]
./darknet[0x402999]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f8e7b786830]
./darknet[0x403849]
======= Memory map: ========
00400000-00582000 r-xp 00000000 08:06 7472883 /home/madan/darknet_my/darknet/darknet
00781000-00782000 rw-p 00181000 08:06 7472883 /home/madan/darknet_my/darknet/darknet
00782000-00783000 rw-p 00000000 00:00 0
01590000-06b42000 rw-p 00000000 00:00 0 [heap]
200000000-200200000 rw-s 01a06000 00:06 501 /dev/nvidiactl
200200000-200400000 ---p 00000000 00:00 0
200400000-200404000 rw-s 8be00000 00:06 501 /dev/nvidiactl
200404000-200600000 ---p 00000000 00:00 0
200600000-200a00000 rw-s 8be05000 00:06 501 /dev/nvidiactl
200a00000-201600000 ---p 00000000 00:00 0
201600000-201604000 rw-s 25eab3000 00:06 501 /dev/nvidiactl
201604000-201800000 ---p 00000000 00:00 0
201800000-201c00000 rw-s 2616fb000 00:06 501 /dev/nvidiactl
201c00000-202800000 ---p 00000000 00:00 0
202800000-202804000 rw-s 10aa96000 00:06 501 /dev/nvidiactl
202804000-202a00000 ---p 00000000 00:00 0
202a00000-202e00000 rw-s 13abf3000 00:06 501 /dev/nvidiactl
202e00000-203a00000 ---p 00000000 00:00 0
203a00000-203a04000 rw-s 109b46000 00:06 501 /dev/nvidiactl
203a04000-203c00000 ---p 00000000 00:00 0
203c00000-204000000 rw-s 109b5c000 00:06 501 /dev/nvidiactl
204000000-204c00000 ---p 00000000 00:00 0
204c00000-204c04000 rw-s 167ab000 00:06 501 /dev/nvidiactl
204c04000-204e00000 ---p 00000000 00:00 0
204e00000-205200000 rw-s 167bc000 00:06 501 /dev/nvidiactl
205200000-205e00000 ---p 00000000 00:00 0
205e00000-205e04000 rw-s 12b6b8000 00:06 501 /dev/nvidiactl
205e04000-206000000 ---p 00000000 00:00 0
206000000-206400000 rw-s 2611a5000 00:06 501 /dev/nvidiactl
206400000-207000000 ---p 00000000 00:00 0
207000000-207004000 rw-s 101490000 00:06 501 /dev/nvidiactl
207004000-207200000 ---p 00000000 00:00 0
207200000-207600000 rw-s 10149d000 00:06 501 /dev/nvidiactl
207600000-208200000 ---p 00000000 00:00 0
208200000-208204000 rw-s 125108000 00:06 501 /dev/nvidiactl
208204000-208400000 ---p 00000000 00:00 0
208400000-208800000 rw-s 125115000 00:06 501 /dev/nvidiactl
208800000-209400000 ---p 00000000 00:00 0
209400000-209404000 rw-s 0ff30000 00:06 501 /dev/nvidiactl
209404000-209600000 ---p 00000000 00:00 0
209600000-209a00000 rw-s 0aec5000 00:06 501 /dev/nvidiactl
209a00000-209a04000 rw-s 10178c000 00:06 501 /dev/nvidiactl
209a04000-209c00000 ---p 00000000 00:00 0
209c00000-20a000000 rw-s 1017a5000 00:06 501 /dev/nvidiactl
20a000000-20a004000 rw-s 1014e8000 00:06 501 /dev/nvidiactl
20a004000-20a200000 ---p 00000000 00:00 0
20a200000-20a600000 rw-s 1014f5000 00:06 501 /dev/nvidiactl
20a600000-20a604000 rw-s 12b3c0000 00:06 501 /dev/nvidiactl
20a604000-20a800000 ---p 00000000 00:00 0
20a800000-20ac00000 rw-s 12b3cd000 00:06 501 /dev/nvidiactl
20ac00000-20ac04000 rw-s 1675e000 00:06 501 /dev/nvidiactl
20ac04000-20ae00000 ---p 00000000 00:00 0
20ae00000-20b200000 rw-s 15887000 00:06 501 /dev/nvidiactl
20b200000-20b204000 rw-s 106581000 00:06 501 /dev/nvidiactl
20b204000-20b400000 ---p 00000000 00:00 0
20b400000-20b800000 rw-s 10659e000 00:06 501 /dev/nvidiactl
20b800000-20b804000 rw-s 13a921000 00:06 501 /dev/nvidiactl
20b804000-20ba00000 ---p 00000000 00:00 0
20ba00000-20be00000 rw-s 13a92e000 00:06 501 /dev/nvidiactl
20be00000-20be04000 rw-s 10a8b9000 00:06 501 /dev/nvidiactl
20be04000-20c000000 ---p 00000000 00:00 0
20c000000-20c400000 rw-s 10a8d2000 00:06 501 /dev/nvidiactl
20c400000-20c600000 ---p 00000000 00:00 0
20c600000-20c800000 rw-s 1253fd000 00:06 501 /dev/nvidiactl
20c800000-300200000 ---p 00000000 00:00 0
10000000000-10204200000 ---p 00000000 00:00 0
10204200000-10204400000 rw-s 15bb1000 00:06 501 /dev/nvidiactl
10204400000-10204600000 rw-s 107870000 00:06 501 /dev/nvidiactl
10204600000-10204800000 rw-s 115a0a000 00:06 501 /dev/nvidiactl
10204800000-10204ad6000 rw-s 101511000 00:06 501 /dev/nvidiactl
10204ad6000-10215a00000 ---p 00000000 00:00 0
7f8e64000000-7f8e64021000 rw-p 00000000 00:00 0
7f8e64021000-7f8e68000000 ---p 00000000 00:00 0
7f8e68000000-7f8e68021000 rw-p 00000000 00:00 0
7f8e68021000-7f8e6c000000 ---p 00000000 00:00 0
7f8e6c000000-7f8e6c021000 rw-p 00000000 00:00 0
7f8e6c021000-7f8e70000000 ---p 00000000 00:00 0
7f8e71270000-7f8e71271000 ---p 00000000 00:00 0
7f8e71271000-7f8e71a71000 rw-p 00000000 00:00 0
7f8e71a71000-7f8e71a72000 ---p 00000000 00:00 0
7f8e71a72000-7f8e746f7000 rw-p 00000000 00:00 0
7f8e746f7000-7f8e746f8000 ---p 00000000 00:00 0
7f8e746f8000-7f8e74ef8000 rw-p 00000000 00:00 0
7f8e74ef8000-7f8e7aef8000 ---p 00000000 00:00 0
7f8e7aef8000-7f8e7af0e000 r-xp 00000000 08:06 10358968 /home/madan/gcc/lib64/libgcc_s.so.1
7f8e7af0e000-7f8e7b10d000 ---p 00016000 08:06 10358968 /home/madan/gcc/lib64/libgcc_s.so.1
7f8e7b10d000-7f8e7b10e000 rw-p 00015000 08:06 10358968 /home/madan/gcc/lib64/libgcc_s.so.1
7f8e7b10e000-7f8e7b150000 r-xp 00000000 08:05 1709331 /usr/lib/nvidia-375/libnvidia-fatbinaryloader.so.375.66
7f8e7b150000-7f8e7b34f000 ---p 00042000 08:05 1709331 /usr/lib/nvidia-375/libnvidia-fatbinaryloader.so.375.66
7f8e7b34f000-7f8e7b359000 rw-p 00041000 08:05 1709331 /usr/lib/nvidia-375/libnvidia-fatbinaryloader.so.375.66
7f8e7b359000-7f8e7b35a000 rw-p 00000000 00:00 0
7f8e7b35a000-7f8e7b361000 r-xp 00000000 08:05 9179793 /lib/x86_64-linux-gnu/librt-2.23.so
7f8e7b361000-7f8e7b560000 ---p 00007000 08:05 9179793 /lib/x86_64-linux-gnu/librt-2.23.so
7f8e7b560000-7f8e7b561000 r--p 00006000 08:05 9179793 /lib/x86_64-linux-gnu/librt-2.23.so
7f8e7b561000-7f8e7b562000 rw-p 00007000 08:05 9179793 /lib/x86_64-linux-gnu/librt-2.23.so
7f8e7b562000-7f8e7b565000 r-xp 00000000 08:05 9179813 /lib/x86_64-linux-gnu/libdl-2.23.so
7f8e7b565000-7f8e7b764000 ---p 00003000 08:05 9179813 /lib/x86_64-linux-gnu/libdl-2.23.so
7f8e7b764000-7f8e7b765000 r--p 00002000 08:05 9179813 /lib/x86_64-linux-gnu/libdl-2.23.so
7f8e7b765000-7f8e7b766000 rw-p 00003000 08:05 9179813 /lib/x86_64-linux-gnu/libdl-2.23.so
7f8e7b766000-7f8e7b926000 r-xp 00000000 08:05 9181869 /lib/x86_64-linux-gnu/libc-2.23.so
7f8e7b926000-7f8e7bb26000 ---p 001c0000 08:05 9181869 /lib/x86_64-linux-gnu/libc-2.23.so
7f8e7bb26000-7f8e7bb2a000 r--p 001c0000 08:05 9181869 /lib/x86_64-linux-gnu/libc-2.23.so
7f8e7bb2a000-7f8e7bb2c000 rw-p 001c4000 08:05 9181869 /lib/x86_64-linux-gnu/libc-2.23.so
7f8e7bb2c000-7f8e7bb30000 rw-p 00000000 00:00 0
7f8e7bb30000-7f8e7bb48000 r-xp 00000000 08:05 9179756 /lib/x86_64-linux-gnu/libpthread-2.23.so
7f8e7bb48000-7f8e7bd47000 ---p 00018000 08:05 9179756 /lib/x86_64-linux-gnu/libpthread-2.23.so
7f8e7bd47000-7f8e7bd48000 r--p 00017000 08:05 9179756 /lib/x86_64-linux-gnu/libpthread-2.23.so
7f8e7bd48000-7f8e7bd49000 rw-p 00018000 08:05 9179756 /lib/x86_64-linux-gnu/libpthread-2.23.so
7f8e7bd49000-7f8e7bd4d000 rw-p 00000000 00:00 0
7f8e7bd4d000-7f8e7be38000 r-xp 00000000 08:06 10359696 /home/madan/gcc/lib64/libstdc++.so.6.0.20
7f8e7be38000-7f8e7c038000 ---p 000eb000 08:06 10359696 /home/madan/gcc/lib64/libstdc++.so.6.0.20
7f8e7c038000-7f8e7c040000 r--p 000eb000 08:06 10359696 /home/madan/gcc/lib64/libstdc++.so.6.0.20
7f8e7c040000-7f8e7c042000 rw-p 000f3000 08:06 10359696 /home/madan/gcc/lib64/libstdc++.so.6.0.20
7f8e7c042000-7f8e7c057000 rw-p 00000000 00:00 0
7f8e7c057000-7f8e7dde4000 r-xp 00000000 08:06 8259936 /home/madan/cuda7/lib64/libcurand.so.7.5.18
7f8e7dde4000-7f8e7dfe4000 ---p 01d8d000 08:06 8259936 /home/madan/cuda7/lib64/libcurand.so.7.5.18
7f8e7dfe4000-7f8e7f3b5000 rw-p 01d8d000 08:06 8259936 /home/madan/cuda7/lib64/libcurand.so.7.5.18
7f8e7f3b5000-7f8e7f8bf000 rw-p 00000000 00:00 0
7f8e7f8bf000-7f8e80f88000 r-xp 00000000 08:06 8259935 /home/madan/cuda7/lib64/libcublas.so.7.5.18
7f8e80f88000-7f8e81187000 ---p 016c9000 08:06 8259935 /home/madan/cuda7/lib64/libcublas.so.7.5.18
7f8e81187000-7f8e81193000 rw-p 016c8000 08:06 8259935 /home/madan/cuda7/lib64/libcublas.so.7.5.18
7f8e81193000-7f8e8119e000 rw-p 00000000 00:00 0
7f8e8119e000-7f8e811f9000 r-xp 00000000 08:06 8259942 /home/madan/cuda7/lib64/libcudart.so.7.5.18
7f8e811f9000-7f8e813f8000 ---p 0005b000 08:06 8259942 /home/madan/cuda7/lib64/libcudart.so.7.5.18
7f8e813f8000-7f8e813fc000 rw-p 0005a000 08:06 8259942 /home/madan/cuda7/lib64/libcudart.so.7.5.18
7f8e813fc000-7f8e81abe000 r-xp 00000000 08:05 1312556 /usr/lib/x86_64-linux-gnu/libcuda.so.375.66
7f8e81abe000-7f8e81cbd000 ---p 006c2000 08:05 1312556 /usr/lib/x86_64-linux-gnu/libcuda.so.375.66
7f8e81cbd000-7f8e81dd8000 rw-p 006c1000 08:05 1312556 /usr/lib/x86_64-linux-gnu/libcuda.so.375.66
7f8e81dd8000-7f8e81de5000 rw-p 00000000 00:00 0
7f8e81de5000-7f8e81eed000 r-xp 00000000 08:05 9181860 /lib/x86_64-linux-gnu/libm-2.23.so
7f8e81eed000-7f8e820ec000 ---p 00108000 08:05 9181860 /lib/x86_64-linux-gnu/libm-2.23.so
7f8e820ec000-7f8e820ed000 r--p 00107000 08:05 9181860 /lib/x86_64-linux-gnu/libm-2.23.so
7f8e820ed000-7f8e820ee000 rw-p 00108000 08:05 9181860 /lib/x86_64-linux-gnu/libm-2.23.so
7f8e820ee000-7f8e82114000 r-xp 00000000 08:05 9176655 /lib/x86_64-linux-gnu/ld-2.23.so
7f8e82128000-7f8e822da000 rw-p 00000000 00:00 0
7f8e822f0000-7f8e822f1000 rw-p 00000000 00:00 0
7f8e822f1000-7f8e822f2000 rw-s cfdf3000 00:06 502 /dev/nvidia0
7f8e822f2000-7f8e822f3000 rw-s 15b97000 00:06 501 /dev/nvidiactl
7f8e822f3000-7f8e822f4000 rw-s cfdf3000 00:06 502 /dev/nvidia0
7f8e822f4000-7f8e822f5000 rw-s 10a8b8000 00:06 501 /dev/nvidiactl
7f8e822f5000-7f8e822f6000 rw-s cfdf3000 00:06 502 /dev/nvidia0
7f8e822f6000-7f8e822f7000 rw-s 13a920000 00:06 501 /dev/nvidiactl
7f8e822f7000-7f8e822f8000 rw-s cfdf3000 00:06 502 /dev/nvidia0
7f8e822f8000-7f8e822f9000 rw-s 106580000 00:06 501 /dev/nvidiactl
7f8e822f9000-7f8e822fa000 rw-s cfdf3000 00:06 502 /dev/nvidia0
7f8e822fa000-7f8e822fb000 rw-s 1675d000 00:06 501 /dev/nvidiactl
7f8e822fb000-7f8e822fc000 rw-s cfdf3000 00:06 502 /dev/nvidia0
7f8e822fc000-7f8e822fd000 rw-s 10643f000 00:06 501 /dev/nvidiactl
7f8e822fd000-7f8e822fe000 rw-s cfdf3000 00:06 502 /dev/nvidia0
7f8e822fe000-7f8e822ff000 rw-s 1014e7000 00:06 501 /dev/nvidiactl
7f8e822ff000-7f8e82300000 rw-s cfdf3000 00:06 502 /dev/nvidia0
7f8e82300000-7f8e82301000 rw-s 10178b000 00:06 501 /dev/nvidiactl
7f8e82301000-7f8e82302000 rw-s cfdf2000 00:06 502 /dev/nvidia0
7f8e82302000-7f8e82303000 rw-s 0ff2d000 00:06 501 /dev/nvidiactl
7f8e82303000-7f8e82304000 rw-s cfdf2000 00:06 502 /dev/nvidia0
7f8e82304000-7f8e82305000 rw-s 125107000 00:06 501 /dev/nvidiactl
7f8e82305000-7f8e82306000 rw-s cfdf2000 00:06 502 /dev/nvidia0
7f8e82306000-7f8e82307000 rw-s 10148f000 00:06 501 /dev/nvidiactl
7f8e82307000-7f8e82308000 rw-s cfdf2000 00:06 502 /dev/nvidia0
7f8e82308000-7f8e82309000 rw-s 12b6b7000 00:06 501 /dev/nvidiactl
7f8e82309000-7f8e8230a000 rw-s cfdf2000 00:06 502 /dev/nvidia0
7f8e8230a000-7f8e8230b000 rw-s 167aa000 00:06 501 /dev/nvidiactl
7f8e8230b000-7f8e8230c000 rw-s cfdf2000 00:06 502 /dev/nvidia0
7f8e8230c000-7f8e8230d000 rw-s 109b45000 00:06 501 /dev/nvidiactl
7f8e8230d000-7f8e8230e000 rw-s cfdf2000 00:06 502 /dev/nvidia0
7f8e8230e000-7f8e8230f000 rw-s 10aa95000 00:06 501 /dev/nvidiactl
7f8e8230f000-7f8e82310000 rw-s cfdf2000 00:06 502 /dev/nvidia0
7f8e82310000-7f8e82311000 rw-s 25eab2000 00:06 501 /dev/nvidiactl
7f8e82311000-7f8e82313000 rw-p 00000000 00:00 0
7f8e82313000-7f8e82314000 r--p 00025000 08:05 9176655 /lib/x86_64-linux-gnu/ld-2.23.so
7f8e82314000-7f8e82315000 rw-p 00026000 08:05 9176655 /lib/x86_64-linux-gnu/ld-2.23.so
7f8e82315000-7f8e82316000 rw-p 00000000 00:00 0
7ffca3626000-7ffca3647000 rw-p 00000000 00:00 0 [stack]
7ffca3715000-7ffca3717000 r--p 00000000 00:00 0 [vvar]
7ffca3717000-7ffca3719000 r-xp 00000000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
Aborted
`

A trouble while I train a model with my own dataset

default

I prepared a dataset to train by yolo2.But there is a trouble.I can use yolo2 to train VOC dataset.
Is it said my GPU memory is not enough?
Anyone can help me ? Thank you!

PS: I change the classes of cfg/yolo-voc.cfg to 5.

why run yolov1/tiny-yolo.cfg, Detection Avg IOU: -nan, Pos Cat: -nan, All Cat: -nan, Pos Obj: -nan, Any Obj: 0.000000, count: 0

./darknet detector train cfg/voc.data cfg/yolov1/tiny-yolo.cfg
tiny-yolo
layer filters size input output
0 conv 16 3 x 3 / 1 448 x 448 x 3 -> 448 x 448 x 16
1 max 2 x 2 / 2 448 x 448 x 16 -> 224 x 224 x 16
2 conv 32 3 x 3 / 1 224 x 224 x 16 -> 224 x 224 x 32
3 max 2 x 2 / 2 224 x 224 x 32 -> 112 x 112 x 32
4 conv 64 3 x 3 / 1 112 x 112 x 32 -> 112 x 112 x 64
5 max 2 x 2 / 2 112 x 112 x 64 -> 56 x 56 x 64
6 conv 128 3 x 3 / 1 56 x 56 x 64 -> 56 x 56 x 128
7 max 2 x 2 / 2 56 x 56 x 128 -> 28 x 28 x 128
8 conv 256 3 x 3 / 1 28 x 28 x 128 -> 28 x 28 x 256
9 max 2 x 2 / 2 28 x 28 x 256 -> 14 x 14 x 256
10 conv 512 3 x 3 / 1 14 x 14 x 256 -> 14 x 14 x 512
11 max 2 x 2 / 2 14 x 14 x 512 -> 7 x 7 x 512
12 conv 1024 3 x 3 / 1 7 x 7 x 512 -> 7 x 7 x1024
13 conv 256 3 x 3 / 1 7 x 7 x1024 -> 7 x 7 x 256
14 connected 12544 -> 1470
15 Detection Layer
forced: Using default '0'
Learning Rate: 0.001, Momentum: 0.9, Decay: 0.0005
Loaded: 8.935500 seconds
Detection Avg IOU: -nan, Pos Cat: -nan, All Cat: -nan, Pos Obj: -nan, Any Obj: 0.000000, count: 0
Detection Avg IOU: -nan, Pos Cat: -nan, All Cat: -nan, Pos Obj: -nan, Any Obj: 0.000000, count: 0
1: 0.000000, 0.000000 avg, 0.001000 rate, 3.704334 seconds, 64 images
Loaded: 4.892096 seconds
Detection Avg IOU: -nan, Pos Cat: -nan, All Cat: -nan, Pos Obj: -nan, Any Obj: 0.000000, count: 0
Detection Avg IOU: -nan, Pos Cat: -nan, All Cat: -nan, Pos Obj: -nan, Any Obj: 0.000000, count: 0
2: 0.000000, 0.000000 avg, 0.001000 rate, 1.871806 seconds, 128 images
Loaded: 6.293604 seconds
Detection Avg IOU: -nan, Pos Cat: -nan, All Cat: -nan, Pos Obj: -nan, Any Obj: 0.000000, count: 0
Detection Avg IOU: -nan, Pos Cat: -nan, All Cat: -nan, Pos Obj: -nan, Any Obj: 0.000000, count: 0
3: 0.000000, 0.000000 avg, 0.001000 rate, 2.049604 seconds, 192 images
Loaded: 6.447800 seconds
Detection Avg IOU: -nan, Pos Cat: -nan, All Cat: -nan, Pos Obj: -nan, Any Obj: 0.000000, count: 0
Detection Avg IOU: -nan, Pos Cat: -nan, All Cat: -nan, Pos Obj: -nan, Any Obj: 0.000000, count: 0
4: 0.000000, 0.000000 avg, 0.001000 rate, 1.846883 seconds, 256 images
Loaded: 7.217837 seconds
Detection Avg IOU: -nan, Pos Cat: -nan, All Cat: -nan, Pos Obj: -nan, Any Obj: 0.000000, count: 0
Detection Avg IOU: -nan, Pos Cat: -nan, All Cat: -nan, Pos Obj: -nan, Any Obj: 0.000000, count: 0
5: 0.000000, 0.000000 avg, 0.001000 rate, 2.000463 seconds, 320 images
Loaded: 6.125922 seconds
Detection Avg IOU: -nan, Pos Cat: -nan, All Cat: -nan, Pos Obj: -nan, Any Obj: 0.000000, count: 0
Detection Avg IOU: -nan, Pos Cat: -nan, All Cat: -nan, Pos Obj: -nan, Any Obj: 0.000000, count: 0
6: 0.000000, 0.000000 avg, 0.001000 rate, 1.845230 seconds, 384 images
Loaded: 6.361571 seconds
Detection Avg IOU: -nan, Pos Cat: -nan, All Cat: -nan, Pos Obj: -nan, Any Obj: 0.000000, count: 0
Detection Avg IOU: -nan, Pos Cat: -nan, All Cat: -nan, Pos Obj: -nan, Any Obj: 0.000000, count: 0
7: 0.000000, 0.000000 avg, 0.001000 rate, 1.877696 seconds, 448 images

How to fix it? Please, help me. Thank you!

A trouble when I test image

I have train my own dataset with a version darknet(with GPU= 1,cuDNN = 1, OPENCV = 1). The result of training just okay with a loss about 1 and IoU about 0.8. But I can't use the command ./darknet detector test cfg/my.data cfg/my.cfg backup/my.weights data/mytest.jpg to test image. It can not detect any thing.
On another way, I try to use the same command with another version(GPU = 1,cuDNN = 0,OPENCV = 1) to detect. It work well. It can draw the boxes and print the name and probability.
The difference between two version just with/without cuDNN.
What is the reason?Any one can tell me?
Thank you!

Failed to write image predictions.png

when I run the detector: ./darknet detect cfg/yolo.cfg yolo.weights data/dog.jpg
It has the result as the followings:
Loading weights from yolo.weights...Done!
data/dog.jpg: Predicted in 19.226688 seconds.
dog: 82%
truck: 64%
bicycle: 85%
Failed to write image predictions.png

Have any ideas?
Thanks!

rnn: Segmentation fault: 11

I did the rnn training with:

make clean && make
./darknet rnn train cfg/rnn.train.cfg -file /root/text_dataset.txt

rnn
layer     filters    size              input                output
    0 RNN Layer: 256 inputs, 1024 outputs
		connected                             256  ->  1024
		connected                            1024  ->  1024
		connected                            1024  ->  1024
Unused field: 'hidden = 1024'
    1 RNN Layer: 1024 inputs, 1024 outputs
		connected                            1024  ->  1024
		connected                            1024  ->  1024
		connected                            1024  ->  1024
Unused field: 'hidden = 1024'
    2 RNN Layer: 1024 inputs, 1024 outputs
		connected                            1024  ->  1024
		connected                            1024  ->  1024
		connected                            1024  ->  1024
Unused field: 'hidden = 1024'
    3 connected                            1024  ->   256
    4 softmax                                         256
    5 cost                                            256
Learning Rate: 0.1, Momentum: 0.9, Decay: 0.001, Inputs: 256 73728 576
Segmentation fault: 11

I have changed the train_char_rnn with the right folder. The input file is a text file with 15448 lines (\n), ASCII encoded:

[loretoparisi@:mbploreto darknet]$ file /root/text_dataset.txt
/root/text_dataset.txt: ASCII text

Since I was not sure about the dataset, I have tried the shakespeare.txt file I have used with another char-rnn, but I get the same segmentation fault error!

I get the same error on Ubuntu16.04LTS

$:~/darknet# ./darknet rnn generate cfg/rnn.cfg ../shakespeare.weights -srand 0 -len 1000
rnn
layer     filters    size              input                output
    0 RNN Layer: 256 inputs, 1024 outputs
		connected                             256  ->  1024
		connected                            1024  ->  1024
		connected                            1024  ->  1024
Unused field: 'hidden = 1024'
    1 RNN Layer: 1024 inputs, 1024 outputs
		connected                            1024  ->  1024
		connected                            1024  ->  1024
		connected                            1024  ->  1024
Unused field: 'hidden = 1024'
    2 RNN Layer: 1024 inputs, 1024 outputs
		connected                            1024  ->  1024
		connected                            1024  ->  1024
		connected                            1024  ->  1024
Unused field: 'hidden = 1024'
    3 connected                            1024  ->   256
    4 softmax                                         256
    5 cost                                            256
Loading weights from ../shakespeare.weights...Done!


                     ATHENILIA.                        [Shouts dead]
    But see thy honour, bless, that words ere stands
    Of your discreet hath revented I a high
    fashion of only worth is, they thanks I be a strange
    end.
  MARIANA. Be valiant, strange; though you are come to me.
    You that the trumpets sound to this earth
    The summer in this isle of all my mind,
    The Duke of Caesar doth seek for joy to him.
  PANDARUS. That she's a precious devil on him?
  ACHILLES.  [To BERTRAM]  My lord, you have not seen thee affection.
  CASSIUS. I pray you, sir, hath henceforth
    The poor other with your honour of his head,
    Which all the rest op the stage of her going;
    Then there may lead the court of mine honours
    Than in the east learned kingdoms force,
    And see the world and made me to my sister
    Good bow's nose mad in honour with thy bones;
    But such a different sound of fears
    Poor far of day of lines of love was like
    The chain of comfort from t

but

./darknet rnn train cfg/rnn.train.cfg -file ../shakespeare.txt 
rnn
layer     filters    size              input                output
    0 RNN Layer: 256 inputs, 1024 outputs
		connected                             256  ->  1024
		connected                            1024  ->  1024
		connected                            1024  ->  1024
Unused field: 'hidden = 1024'
    1 RNN Layer: 1024 inputs, 1024 outputs
		connected                            1024  ->  1024
		connected                            1024  ->  1024
		connected                            1024  ->  1024
Unused field: 'hidden = 1024'
    2 RNN Layer: 1024 inputs, 1024 outputs
		connected                            1024  ->  1024
		connected                            1024  ->  1024
		connected                            1024  ->  1024
Unused field: 'hidden = 1024'
    3 connected                            1024  ->   256
    4 softmax                                         256
    5 cost                                            256
Learning Rate: 0.1, Momentum: 0.9, Decay: 0.001, Inputs: 256 73728 576
Segmentation fault

nightmare: Segfault from freeing already freed memory when GPU=0 and iters>=2

(Notice: you'll probably want to patch this other bug first because you may not even get past network config parsing otherwise.)

When compiled with -DGPU=0, optimize_picture()in examples/nightmare.c sets net->input = im.data; on line 65 and then does free_image(im); on line 102 without ever clearing net->input. If iters==1 nothing bad happens, but if there are multiple iterations then resize_network() will do free(net->input); on that same already freed pointer during the next iteration.

The fix is to add net->input = NULL; after backward_network(*net); in optimize_picture().

Shell output:

$ ./darknet nightmare cfg/jnet-conv.cfg jnet-conv.weights data/scream.jpg 2 -iters 2
policy: Using default 'constant'
max_batches: Using default '0'
layer     filters    size              input                output
    0 conv     32  3 x 3 / 1    10 x  10 x   3   ->    10 x  10 x  32
    1 conv     32  3 x 3 / 1    10 x  10 x  32   ->    10 x  10 x  32
    2 max          2 x 2 / 2    10 x  10 x  32   ->     5 x   5 x  32
    3 conv     64  3 x 3 / 1     5 x   5 x  32   ->     5 x   5 x  64
    4 conv     64  3 x 3 / 1     5 x   5 x  64   ->     5 x   5 x  64
    5 max          2 x 2 / 2     5 x   5 x  64   ->     3 x   3 x  64
    6 conv    128  3 x 3 / 1     3 x   3 x  64   ->     3 x   3 x 128
    7 conv    128  3 x 3 / 1     3 x   3 x 128   ->     3 x   3 x 128
    8 max          2 x 2 / 2     3 x   3 x 128   ->     2 x   2 x 128
    9 conv    256  3 x 3 / 1     2 x   2 x 128   ->     2 x   2 x 256
   10 conv    256  3 x 3 / 1     2 x   2 x 256   ->     2 x   2 x 256
   11 max          2 x 2 / 2     2 x   2 x 256   ->     1 x   1 x 256
   12 conv    512  3 x 3 / 1     1 x   1 x 256   ->     1 x   1 x 512
   13 conv    512  3 x 3 / 1     1 x   1 x 512   ->     1 x   1 x 512
   14 max          2 x 2 / 2     1 x   1 x 512   ->     1 x   1 x 512
   15 conv   1024  3 x 3 / 1     1 x   1 x 512   ->     1 x   1 x1024
   16 conv   1024  3 x 3 / 1     1 x   1 x1024   ->     1 x   1 x1024
   17 max          2 x 2 / 2     1 x   1 x1024   ->     1 x   1 x1024
Loading weights from jnet-conv.weights...Done!
Iteration: 0, 1, Segmentation fault (core dumped)

GDB backtrace:

#0  __GI___libc_free (mem=0x7f01f4d70010) at malloc.c:2966
        ar_ptr = <optimized out>
        p = <optimized out>
        hook = 0x0
#1  0x00005560520010a9 in resize_network (net=net@entry=0x7ffd0bff3c70, w=<optimized out>, w@entry=148, h=<optimized out>, h@entry=189) at ./src/network.c:374
        i = 3
        inputs = <optimized out>
        workspace_size = 32223744
        out = {type = MAXPOOL, activation = LOGISTIC, cost_type = SSE, forward = 0x55605201591e <forward_maxpool_layer>, backward = 0x556052015ace <backward_maxpool_layer>, update = 0x0, 
          forward_gpu = 0x0, backward_gpu = 0x0, update_gpu = 0x0, batch_normalize = 0, shortcut = 0, batch = 1, forced = 0, flipped = 0, inputs = 895104, outputs = 224960, nweights = 0, 
          nbiases = 0, extra = 0, truths = 0, h = 189, w = 148, c = 32, out_h = 95, out_w = 74, out_c = 32, n = 0, max_boxes = 0, groups = 0, size = 2, side = 0, stride = 2, reverse = 0, 
          flatten = 0, spatial = 0, pad = 0, sqrt = 0, flip = 0, index = 0, binary = 0, xnor = 0, steps = 0, hidden = 0, truth = 0, smooth = 0, dot = 0, angle = 0, jitter = 0, 
          saturation = 0, exposure = 0, shift = 0, ratio = 0, learning_rate_scale = 1, softmax = 0, classes = 0, coords = 0, background = 0, rescore = 0, objectness = 0, does_cost = 0, 
          joint = 0, noadjust = 0, reorg = 0, log = 0, tanh = 0, alpha = 0, beta = 0, kappa = 0, coord_scale = 0, object_scale = 0, noobject_scale = 0, mask_scale = 0, class_scale = 0, 
          bias_match = 0, random = 0, thresh = 0, classfix = 0, absolute = 0, onlyforward = 0, stopbackward = 0, dontload = 0, dontloadscales = 0, temperature = 0, probability = 0, 
          scale = 0, cweights = 0x0, indexes = 0x7f01efb9b010, input_layers = 0x0, input_sizes = 0x0, map = 0x0, rand = 0x0, cost = 0x0, state = 0x0, prev_state = 0x0, forgot_state = 0x0, 
          forgot_delta = 0x0, state_delta = 0x0, combine_cpu = 0x0, combine_delta_cpu = 0x0, concat = 0x0, concat_delta = 0x0, binary_weights = 0x0, biases = 0x0, bias_updates = 0x0, 
          scales = 0x0, scale_updates = 0x0, weights = 0x0, weight_updates = 0x0, delta = 0x7f01ef1f9010, output = 0x7f01ef6ca010, squared = 0x0, norms = 0x0, spatial_mean = 0x0, 
          mean = 0x0, variance = 0x0, mean_delta = 0x0, variance_delta = 0x0, rolling_mean = 0x0, rolling_variance = 0x0, x = 0x0, x_norm = 0x0, m = 0x0, v = 0x0, bias_m = 0x0, 
          bias_v = 0x0, scale_m = 0x0, scale_v = 0x0, z_cpu = 0x0, r_cpu = 0x0, h_cpu = 0x0, prev_state_cpu = 0x0, temp_cpu = 0x0, temp2_cpu = 0x0, temp3_cpu = 0x0, dh_cpu = 0x0, 
          hh_cpu = 0x0, prev_cell_cpu = 0x0, cell_cpu = 0x0, f_cpu = 0x0, i_cpu = 0x0, g_cpu = 0x0, o_cpu = 0x0, c_cpu = 0x0, dc_cpu = 0x0, binary_input = 0x0, input_layer = 0x0, 
          self_layer = 0x0, output_layer = 0x0, reset_layer = 0x0, update_layer = 0x0, state_layer = 0x0, input_gate_layer = 0x0, state_gate_layer = 0x0, input_save_layer = 0x0, 
          state_save_layer = 0x0, input_state_layer = 0x0, state_state_layer = 0x0, input_z_layer = 0x0, state_z_layer = 0x0, input_r_layer = 0x0, state_r_layer = 0x0, input_h_layer = 0x0, 
          state_h_layer = 0x0, wz = 0x0, uz = 0x0, wr = 0x0, ur = 0x0, wh = 0x0, uh = 0x0, uo = 0x0, wo = 0x0, uf = 0x0, wf = 0x0, ui = 0x0, wi = 0x0, ug = 0x0, wg = 0x0, 
          softmax_tree = 0x0, workspace_size = 0}
#2  0x0000556051fde007 in optimize_picture (net=net@entry=0x7ffd0bff3c70, orig=..., max_layer=max_layer@entry=2, scale=0.421875, rate=rate@entry=0.0399999991, thresh=thresh@entry=1, 
    norm=norm@entry=1) at ./examples/nightmare.c:42
        dx = 1
        dy = 5
        flip = 0
        crop = {w = 352, h = 448, c = 3, data = 0x556054142a40}
        im = {w = 148, h = 189, c = 3, data = 0x556054310a50}
        last = {type = MAXPOOL, activation = LOGISTIC, cost_type = SSE, forward = 0x55605201591e <forward_maxpool_layer>, backward = 0x556052015ace <backward_maxpool_layer>, update = 0x0, 
          forward_gpu = 0x0, backward_gpu = 0x0, update_gpu = 0x0, batch_normalize = 0, shortcut = 0, batch = 1, forced = 0, flipped = 0, inputs = 5046272, outputs = 1261568, nweights = 0, 
          nbiases = 0, extra = 0, truths = 0, h = 448, w = 352, c = 32, out_h = 224, out_w = 176, out_c = 32, n = 0, max_boxes = 0, groups = 0, size = 2, side = 0, stride = 2, reverse = 0, 
          flatten = 0, spatial = 0, pad = 0, sqrt = 0, flip = 0, index = 0, binary = 0, xnor = 0, steps = 0, hidden = 0, truth = 0, smooth = 0, dot = 0, angle = 0, jitter = 0, 
          saturation = 0, exposure = 0, shift = 0, ratio = 0, learning_rate_scale = 1, softmax = 0, classes = 0, coords = 0, background = 0, rescore = 0, objectness = 0, does_cost = 0, 
          joint = 0, noadjust = 0, reorg = 0, log = 0, tanh = 0, alpha = 0, beta = 0, kappa = 0, coord_scale = 0, object_scale = 0, noobject_scale = 0, mask_scale = 0, class_scale = 0, 
          bias_match = 0, random = 0, thresh = 0, classfix = 0, absolute = 0, onlyforward = 0, stopbackward = 0, dontload = 0, dontloadscales = 0, temperature = 0, probability = 0, 
          scale = 0, cweights = 0x0, indexes = 0x7f01efb9b010, input_layers = 0x0, input_sizes = 0x0, map = 0x0, rand = 0x0, cost = 0x0, state = 0x0, prev_state = 0x0, forgot_state = 0x0, 
          forgot_delta = 0x0, state_delta = 0x0, combine_cpu = 0x0, combine_delta_cpu = 0x0, concat = 0x0, concat_delta = 0x0, binary_weights = 0x0, biases = 0x0, bias_updates = 0x0, 
          scales = 0x0, scale_updates = 0x0, weights = 0x0, weight_updates = 0x0, delta = 0x7f01ef1f9010, output = 0x7f01ef6ca010, squared = 0x0, norms = 0x0, spatial_mean = 0x0, 
          mean = 0x0, variance = 0x0, mean_delta = 0x0, variance_delta = 0x0, rolling_mean = 0x0, rolling_variance = 0x0, x = 0x0, x_norm = 0x0, m = 0x0, v = 0x0, bias_m = 0x0, 
          bias_v = 0x0, scale_m = 0x0, scale_v = 0x0, z_cpu = 0x0, r_cpu = 0x0, h_cpu = 0x0, prev_state_cpu = 0x0, temp_cpu = 0x0, temp2_cpu = 0x0, temp3_cpu = 0x0, dh_cpu = 0x0, 
          hh_cpu = 0x0, prev_cell_cpu = 0x0, cell_cpu = 0x0, f_cpu = 0x0, i_cpu = 0x0, g_cpu = 0x0, o_cpu = 0x0, c_cpu = 0x0, dc_cpu = 0x0, binary_input = 0x0, input_layer = 0x0, 
          self_layer = 0x0, output_layer = 0x0, reset_layer = 0x0, update_layer = 0x0, state_layer = 0x0, input_gate_layer = 0x0, state_gate_layer = 0x0, input_save_layer = 0x0, 
          state_save_layer = 0x0, input_state_layer = 0x0, state_state_layer = 0x0, input_z_layer = 0x0, state_z_layer = 0x0, input_r_layer = 0x0, state_r_layer = 0x0, input_h_layer = 0x0, 
          state_h_layer = 0x0, wz = 0x0, uz = 0x1, wr = 0x0, ur = 0x7f01fe5486e0 <stderr>, wh = 0x1, uh = 0x0, uo = 0x2, wo = 0x7f01fe1fd157 <__fprintf+135>, uf = 0x0, wf = 0x3000000018, 
          ui = 0x4000000000000000, wi = 0x7f01fe77bb11 <__ieee754_pow_sse2+785>, ug = 0x0, wg = 0x0, softmax_tree = 0x4008000000000000, workspace_size = 139646535789673}
        delta = {w = 352, h = 448, c = 3, data = 0x556054142a40}
        resized = {w = 352, h = 448, c = 3, data = 0x556054310a50}
        out = {w = 352, h = 448, c = 3, data = 0x5560544dea60}
#3  0x0000556051fdede1 in run_nightmare (argc=<optimized out>, argv=<optimized out>) at ./examples/nightmare.c:382
        layer = 2
        octave = <optimized out>
        buff = "\001\000\000\000\000\000\000\000p1\311\376\001\177", '\000' <repeats 11 times>, "\375\310\376\001\177\000\000\000\000\000\000\000\000\000\000\310\064\311\376\001\177\000\000\240;\377\v\375\177\000\000\200;\377\v\001\000\000\000p1\311\376\001\177\000\000\220;\377\v\375\177\000\000S\254\373Q`U\000\000^\226\223\034\000\000\000\000\377\377\377\377\000\000\000\000\250\321\377\v\375\177\000\000\000\343\033\376\001\177\000\000\220\376\310\376\001\177\000\000\b\000\000\000\000\000\000\000\230\322\377\v\375\177\000\000\b7\311\376\001\177\000\000X<\377\v\375\177\000\000T<\377\v\375\177\000\000\000\000\000\000\000\000\000\000\247\362\060\376\001\177\000\000\360=\377\v\375\177\000\000X<\377\v\375\177\000\000"...
        crop = {w = 1, h = 0, c = 0, data = 0x7ffd0bff3c58}
        resized = {w = 3, h = 0, c = -20380560, data = 0x1}
        cfg = <optimized out>
        weights = <optimized out>
        input = <optimized out>
        range = 1
        norm = 1
        rounds = 1
        iters = 2
        octaves = 4
        zoom = 1
        rate = 0.0399999991
        thresh = 1
        rotate = 0
        momentum = 0.899999976
        lambda = 0.00999999978
        prefix = 0x0
        reconstruct = 0
        smooth_size = 1
        net = {n = 3, batch = 1, seen = 0x556053ee2010, t = 0x556053ee2030, epoch = 0, subdivisions = 1, layers = 0x556053ef19c0, output = 0x7f01ef6ca010, policy = CONSTANT, 
          learning_rate = 0.00999999978, momentum = 0.899999976, decay = 0.000500000024, gamma = 0, scale = 0, power = 4, time_steps = 1, step = 0, max_batches = 0, scales = 0x0, 
          steps = 0x0, num_steps = 0, burn_in = 0, adam = 0, B1 = 0, B2 = 0, eps = 0, inputs = 83916, outputs = 224960, truths = 224960, notruth = 0, h = 189, w = 148, c = 3, max_crop = 20, 
          min_crop = 10, center = 0, angle = 0, aspect = 1, exposure = 1, saturation = 1, hue = 0, gpu_index = -1, hierarchy = 0x0, input = 0x7f01f4d70010, truth = 0x7f01eed28010, 
          delta = 0x556054142a40, workspace = 0x7f01e3fe7010, train = 0, index = 0, cost = 0x556053ee2050}
        cfgbase = 0x556053ee2220 "jnet-conv"
        imbase = 0x556053ee2240 "scream"
        im = {w = 352, h = 448, c = 3, data = 0x7f01f510e010}
        features = 0x0
        update = {w = 0, h = 0, c = -22557532, data = 0x1}
        e = 0
        n = 1
#4  0x0000556051fe2558 in main (argc=8, argv=0x7ffd0bff3ee8) at ./examples/darknet.c:480
No locals.

Install on windows using cygwin ?

Having an issue when installing on windows -- using cygwin
Request help ?

$ make
gcc -Iinclude/ -Isrc/ -Wall -Wno-unknown-pragmas -Wfatal-errors -fPIC -Ofast -c ./src/gemm.c -o obj/gemm.o
process_begin: CreateProcess(NULL, gcc -Iinclude/ -Isrc/ -Wall -Wno-unknown-pragmas -Wfatal-errors -fPIC -Ofast -c ./src/gemm.c -o obj/gemm.o, ...) failed.
make (e=2): The system cannot find the file specified.
make: *** [obj/gemm.o] Error 2

DarkGo multithread

DarkGo only uses one thread and is therefore very slow on CPU with the -multi flag. Please add multithread to DarkGo. Thanks!

Help

@pjreddie How is this project different from caffe
and how do i use it in CPU only ..is it complete project

save the demo results to video file

I find the demo video on the website. and I want to test it on my video file . However, I didn't find the way to save the demo results. Besides, it runs very slow on my server (using Tesla k80). Don't know why.

Self Trained weights different from the official downloaded weights in size.

I try train tiny-yolo-voc.cfg using the VOC dataset and get "tiny-yolo-voc_100.weights" whose file size is 63471560 bytes. And when I look at the file size of tiny-yolo-voc.weights download from the official website, it's file size is 63471556 bytes, with 6 bytes different from the weights I trained. I wonder why is it?

Although there is no difference if I use the darknet framework all the time, I have problem converting my weights to tensorflow required format using darkflow. I can successfully convert the official downloaded weights using darkflow, but I can't convert the weights I trained using darkflow because of the different file size.

The error reported when converting the weights using darkflow can be seen here:
thtrieu/darkflow#325

problem occur when i run video detection

here is command i use
./darknet detector demo cfg/voc.data cfg/test.cfg tiny-yolo-voc.weights ~/python_workspace/test/test2.mp4
i changed my config file to this to make detection faster
[net] batch=64 subdivisions=4 width=320 height=160
it seems work, output fps is over 15

but the video output sometimes very fast even look like 30fps, sometimes very slow looks like 1fps

and the terminal output still 15 fps

did i do something wrong?

help me fix it plz.

Thanks.

depthwise convolution

Hi Joseph,
Do you have any plans to incorporate the depthwise convolution? It should help to improve the inference time. A loop over the channel might work, but slower? Thanks.

YOLO V2 with Kinect v2 and Tensorflow

Hi,

I am using YOLO v2 for object recognition, when I run the following code

./darknet detector demo cfg/voc.data cfg/tiny-yolo-voc.cfg tiny-yolo-voc.weights

I get video stream from the webcam, but I want to get the video stream from the camera Kinect v2. The Yolo V2 get the video stream from cap = cvCaptureFromCAM(cam_index); in the file demo.c in darknet and the kinect v2 get the rgb videos stream from the libfreenect2::Frame *rgb = frames[libfreenect2::Frame::Color];//BGRA format in libfreenct2

I want to use kinect v2 and Yolo v2 for object detection !!!!! Any one can give me help ??

rnn: ./src/cuda.c:36: check_error: Assertion `0' failed.

I'm running cuda8.0 on Ubuntu16.04LTS.

root@29c797bc416c:~/darknet# ./darknet rnn train cfg/rnn.train.cfg -file ./t8.shakespeare.txt 
rnn
layer     filters    size              input                output
    0 RNN Layer: 256 inputs, 1024 outputs
		CUDA Error: out of memory
darknet: ./src/cuda.c:36: check_error: Assertion `0' failed.
Aborted (core dumped)
root@29c797bc416c:~/darknet# nvidia-smi
Fri Jul 21 14:11:16 2017       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 367.57                 Driver Version: 367.57                    |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GRID K520           Off  | 0000:00:03.0     Off |                  N/A |
| N/A   62C    P0   104W / 125W |   3554MiB /  4036MiB |     92%      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID  Type  Process name                               Usage      |
|=============================================================================|
+-----------------------------------------------------------------------------+

Running detection on multiple images with Python - Memory leak?

I am testing the Python API to run detection on thousands of images after each other and I've found that the memory keeps increasing over time until filling it. I haven't experienced similar problems using the C code directly. I am on Ubuntu 14.04.

Here's the python script I am running:

import python.darknet
import os, sys

net = python.darknet.load_net("cfg/yolo.cfg", "weights/yolo.weights", 0)
meta = python.darknet.load_meta("cfg/coco.data")

folder = sys.argv[1]
files = os.listdir(folder)

for f in files:
    if f.endswith(".jpg") or f.endswith(".jpeg") or f.endswith(".png"):
        print f
        path = os.path.join(folder, f)
        im = python.darknet.load_image(path, 0, 0)
        res = python.darknet.detect(net, meta, im)
	print res[:3]

Is it a memory leak? Or is there something else I should consider when running on multiple images in a row?

Commit 62235e9a broke parsing of jnet-conv.cfg

Trying to run nightmare with cfg/jnet-conv.cfg fails due to a parsing error after commit 62235e9a ("cpu batch norm works"):

$ ./darknet nightmare cfg/jnet-conv.cfg jnet-conv.weights data/eagle.jpg 11
policy: Using default 'constant'
max_batches: Using default '0'
layer     filters    size              input                output
    0 conv     32  3 x 3 / 1    10 x  10 x   3   ->    10 x  10 x  32
    1 conv     32  3 x 3 / 1    10 x  10 x  32   ->    10 x  10 x  32
    2 max          2 x 2 / 2    10 x  10 x  32   ->     5 x   5 x  32
    3 conv     64  3 x 3 / 1     5 x   5 x  32   ->     5 x   5 x  64
    4 conv     64  3 x 3 / 1     5 x   5 x  64   ->     5 x   5 x  64
    5 max          2 x 2 / 2     5 x   5 x  64   ->     2 x   2 x  64
    6 conv    128  3 x 3 / 1     2 x   2 x  64   ->     2 x   2 x 128
    7 conv    128  3 x 3 / 1     2 x   2 x 128   ->     2 x   2 x 128
    8 max          2 x 2 / 2     2 x   2 x 128   ->     1 x   1 x 128
    9 conv    256  3 x 3 / 1     1 x   1 x 128   ->     1 x   1 x 256
   10 conv    256  3 x 3 / 1     1 x   1 x 256   ->     1 x   1 x 256
   11 max          2 x 2 / 2     1 x   1 x 256   ->     0 x   0 x 256
   12 Layer before convolutional layer must output image.: Success
darknet: ./src/utils.c:193: error: Assertion `0' failed.
Aborted

Look at layer 11's output size; it says "0 x 0 x 256", which is what causes the error. I found that specifically the changed lines in src/maxpool_layer.c introduced this bug:

$ git show 62235e9aa3d0c15d87d49bf340625d075cba3e65 src/maxpool_layer.c
commit 62235e9aa3d0c15d87d49bf340625d075cba3e65 (HEAD)
Author: Joseph Redmon <[email protected]>
Date:   Fri Nov 18 21:51:36 2016 -0800

    cpu batch norm works

diff --git a/src/maxpool_layer.c b/src/maxpool_layer.c
index d1fbacb..031d116 100644
--- a/src/maxpool_layer.c
+++ b/src/maxpool_layer.c
@@ -27,8 +27,8 @@ maxpool_layer make_maxpool_layer(int batch, int h, int w, int c, int size, int s
     l.w = w;
     l.c = c;
     l.pad = padding;
-    l.out_w = (w + 2*padding - size + 1)/stride + 1;
-    l.out_h = (h + 2*padding - size + 1)/stride + 1;
+    l.out_w = (w + 2*padding)/stride;
+    l.out_h = (h + 2*padding)/stride;
     l.out_c = c;
     l.outputs = l.out_h * l.out_w * l.out_c;
     l.inputs = h*w*c;
@@ -57,8 +57,8 @@ void resize_maxpool_layer(maxpool_layer *l, int w, int h)
     l->w = w;
     l->inputs = h*w*l->c;
 
-    l->out_w = (w + 2*l->pad - l->size + 1)/l->stride + 1;
-    l->out_h = (h + 2*l->pad - l->size + 1)/l->stride + 1;
+    l->out_w = (w + 2*l->pad)/l->stride;
+    l->out_h = (h + 2*l->pad)/l->stride;
     l->outputs = l->out_w * l->out_h * l->c;
     int output_size = l->outputs * l->batch;
 

After removing the above change things work again:

$ ./darknet nightmare cfg/jnet-conv.cfg jnet-conv.weights data/eagle.jpg 11
policy: Using default 'constant'
max_batches: Using default '0'
layer     filters    size              input                output
    0 conv     32  3 x 3 / 1    10 x  10 x   3   ->    10 x  10 x  32
    1 conv     32  3 x 3 / 1    10 x  10 x  32   ->    10 x  10 x  32
    2 max          2 x 2 / 2    10 x  10 x  32   ->     5 x   5 x  32
    3 conv     64  3 x 3 / 1     5 x   5 x  32   ->     5 x   5 x  64
    4 conv     64  3 x 3 / 1     5 x   5 x  64   ->     5 x   5 x  64
    5 max          2 x 2 / 2     5 x   5 x  64   ->     3 x   3 x  64
    6 conv    128  3 x 3 / 1     3 x   3 x  64   ->     3 x   3 x 128
    7 conv    128  3 x 3 / 1     3 x   3 x 128   ->     3 x   3 x 128
    8 max          2 x 2 / 2     3 x   3 x 128   ->     2 x   2 x 128
    9 conv    256  3 x 3 / 1     2 x   2 x 128   ->     2 x   2 x 256
   10 conv    256  3 x 3 / 1     2 x   2 x 256   ->     2 x   2 x 256
   11 max          2 x 2 / 2     2 x   2 x 256   ->     1 x   1 x 256
   12 conv    512  3 x 3 / 1     1 x   1 x 256   ->     1 x   1 x 512
   13 conv    512  3 x 3 / 1     1 x   1 x 512   ->     1 x   1 x 512
   14 max          2 x 2 / 2     1 x   1 x 512   ->     1 x   1 x 512
   15 conv   1024  3 x 3 / 1     1 x   1 x 512   ->     1 x   1 x1024
   16 conv   1024  3 x 3 / 1     1 x   1 x1024   ->     1 x   1 x1024
   17 max          2 x 2 / 2     1 x   1 x1024   ->     1 x   1 x1024
Loading weights from jnet-conv.weights...Done!
Iteration: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, done
0 eagle_jnet-conv_11_000000

So was this a typo, or is there code somewhere else that relies on the change in src/maxpool_layer.c?

heap-buffer-overflow in stbi__create_png_image_raw

Hi.

I found a heap-buffer-overflow bug in Darknet.

Please confirm.

Thanks.

Summary: heap-buffer-overflow
OS: Ubuntu 16.04 32bit
Steps to reproduce:
1.Download the .POC files.
2.Compile the source code with ASan.
3.Execute the following command
: ./darknet imtest $PoC
PoC download : PoC

=================================================================
==19365==ERROR: AddressSanitizer: heap-buffer-overflow on address 0xb5601800 at pc 0x082c3f7e bp 0xbfbe41b8 sp 0xbfbe41ac
WRITE of size 1 at 0xb5601800 thread T0
    #0 0x82c3f7d in stbi__create_png_image_raw /root/karas/darknet/src/stb_image.h:4032:47
    #1 0x82b47cc in stbi__create_png_image /root/karas/darknet/src/stb_image.h:4156:15
    #2 0x82b47cc in stbi__parse_png_file /root/karas/darknet/src/stb_image.h:4415
    #3 0x824b7b8 in stbi__do_png /root/karas/darknet/src/stb_image.h:4458:8
    #4 0x824b7b8 in stbi__png_load /root/karas/darknet/src/stb_image.h:4481
    #5 0x824b7b8 in stbi__load_main /root/karas/darknet/src/stb_image.h:933
    #6 0x8201cfb in stbi__load_flip /root/karas/darknet/src/stb_image.h:969:28
    #7 0x8201cfb in stbi_load_from_file /root/karas/darknet/src/stb_image.h:1044
    #8 0x8246cb3 in stbi_load /root/karas/darknet/src/stb_image.h:1034:13
    #9 0x8246cb3 in load_image_stb /root/karas/darknet/./src/image.c:1371
    #10 0x8245815 in load_image /root/karas/darknet/./src/image.c:1397:17
    #11 0x8245815 in test_resize /root/karas/darknet/./src/image.c:1320
    #12 0x81e9766 in main /root/karas/darknet/./examples/darknet.c:476:9
    #13 0xb7558636 in __libc_start_main /build/glibc-KM3i_a/glibc-2.23/csu/../csu/libc-start.c:291
    #14 0x8067e27 in _start (/root/karas/darknet/darknet+0x8067e27)

0xb5601800 is located 0 bytes to the right of 64-byte region [0xb56017c0,0xb5601800)
allocated by thread T0 here:
    #0 0x811b514 in malloc (/root/karas/darknet/darknet+0x811b514)
    #1 0x82ba2a1 in stbi__malloc /root/karas/darknet/src/stb_image.h:889:12
    #2 0x82ba2a1 in stbi__create_png_image_raw /root/karas/darknet/src/stb_image.h:3967

SUMMARY: AddressSanitizer: heap-buffer-overflow /root/karas/darknet/src/stb_image.h:4032:47 in stbi__create_png_image_raw
Shadow bytes around the buggy address:
  0x36ac02b0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x36ac02c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x36ac02d0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x36ac02e0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x36ac02f0: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
=>0x36ac0300:[fa]fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x36ac0310: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x36ac0320: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x36ac0330: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x36ac0340: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x36ac0350: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Heap right redzone:      fb
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack partial redzone:   f4
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
==19365==ABORTING

extract feature

Hi:
can you provide an example for extracting feature?
thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.