You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(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)
(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()
inexamples/nightmare.c
setsnet->input = im.data;
on line 65 and then doesfree_image(im);
on line 102 without ever clearingnet->input
. Ifiters==1
nothing bad happens, but if there are multiple iterations thenresize_network()
will dofree(net->input);
on that same already freed pointer during the next iteration.The fix is to add
net->input = NULL;
afterbackward_network(*net);
inoptimize_picture()
.Shell output:
GDB backtrace:
The text was updated successfully, but these errors were encountered: