Skip to content

Commit

Permalink
Fix crash (SIGSEGV) on running ./darknet detect cfg/yolo.cfg yolo.wei…
Browse files Browse the repository at this point in the history
…ghts data/dog.jpg

The extern symbol of test_detector is wrong on darknet.c which leads to a SIGSEGV error.
  • Loading branch information
lilohuang committed May 14, 2017
1 parent 9726f1e commit 0701770
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/darknet.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "connected_layer.h"

extern void predict_classifier(char *datacfg, char *cfgfile, char *weightfile, char *filename, int top);
extern void test_detector(char *datacfg, char *cfgfile, char *weightfile, char *filename, float thresh, float hier_thresh);
extern void test_detector(char *datacfg, char *cfgfile, char *weightfile, char *filename, float thresh, float hier_thresh, char *outfile, int fullscreen);
extern void run_voxel(int argc, char **argv);
extern void run_yolo(int argc, char **argv);
extern void run_detector(int argc, char **argv);
Expand Down Expand Up @@ -423,7 +423,9 @@ int main(int argc, char **argv)
} else if (0 == strcmp(argv[1], "detect")){
float thresh = find_float_arg(argc, argv, "-thresh", .24);
char *filename = (argc > 4) ? argv[4]: 0;
test_detector("cfg/coco.data", argv[2], argv[3], filename, thresh, .5);
char *outfile = find_char_arg(argc, argv, "-out", 0);
int fullscreen = find_arg(argc, argv, "-fullscreen");
test_detector("cfg/coco.data", argv[2], argv[3], filename, thresh, .5, outfile, fullscreen);
} else if (0 == strcmp(argv[1], "cifar")){
run_cifar(argc, argv);
} else if (0 == strcmp(argv[1], "go")){
Expand Down

0 comments on commit 0701770

Please sign in to comment.