From accf3a59c8b17c70dcc39e8f7daede017190086d Mon Sep 17 00:00:00 2001
From: AlexeyAB <alexeyab84@gmail.com>
Date: Tue, 31 Oct 2017 19:10:31 +0000
Subject: [PATCH] Validate and recall always with batch=1

---
 src/parser.c   |    2 ++
 src/detector.c |    5 +++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/detector.c b/src/detector.c
index dcb0dd2..ac75524 100644
--- a/src/detector.c
+++ b/src/detector.c
@@ -258,7 +258,7 @@
     int *map = 0;
     if (mapf) map = read_map(mapf);
 
-    network net = parse_network_cfg(cfgfile);
+    network net = parse_network_cfg_custom(cfgfile, 1);
     if(weightfile){
         load_weights(&net, weightfile);
     }
@@ -375,7 +375,7 @@
 
 void validate_detector_recall(char *datacfg, char *cfgfile, char *weightfile)
 {
-    network net = parse_network_cfg(cfgfile);
+    network net = parse_network_cfg_custom(cfgfile, 1);
     if(weightfile){
         load_weights(&net, weightfile);
     }
@@ -552,6 +552,7 @@
     char *datacfg = argv[3];
     char *cfg = argv[4];
     char *weights = (argc > 5) ? argv[5] : 0;
+	if (weights[strlen(weights) - 1] == 0x0d) weights[strlen(weights) - 1] = 0;
     char *filename = (argc > 6) ? argv[6]: 0;
     if(0==strcmp(argv[2], "test")) test_detector(datacfg, cfg, weights, filename, thresh);
     else if(0==strcmp(argv[2], "train")) train_detector(datacfg, cfg, weights, gpus, ngpus, clear);
diff --git a/src/parser.c b/src/parser.c
index 08b2df7..e0fe8f2 100644
--- a/src/parser.c
+++ b/src/parser.c
@@ -1033,11 +1033,13 @@
     fread(&minor, sizeof(int), 1, fp);
     fread(&revision, sizeof(int), 1, fp);
 	if ((major * 10 + minor) >= 2) {
+		printf("\n seen 64 \n");
 		uint64_t iseen = 0;
 		fread(&iseen, sizeof(uint64_t), 1, fp);
 		*net->seen = iseen;
 	}
 	else {
+		printf("\n seen 32 \n");
 		fread(net->seen, sizeof(int), 1, fp);
 	}
     int transpose = (major > 1000) || (minor > 1000);

--
Gitblit v1.10.0