pull/5002/head
AlexeyAB 5 years ago
parent b2fc7b624c
commit b56e8d11cf
  1. 6
      src/classifier.c
  2. 3
      src/network.c

@ -162,8 +162,8 @@ void train_classifier(char *datacfg, char *cfgfile, char *weightfile, int *gpus,
calc_topk_for_each = fmax(calc_topk_for_each, 100); calc_topk_for_each = fmax(calc_topk_for_each, 100);
if (i % 10 == 0) { if (i % 10 == 0) {
if (calc_topk) { if (calc_topk) {
fprintf(stderr, "\n (next TOP5 calculation at %d iterations) ", calc_topk_for_each); fprintf(stderr, "\n (next TOP%d calculation at %d iterations) ", topk_data, calc_topk_for_each);
if (topk > 0) fprintf(stderr, " Last accuracy TOP5 = %2.2f %% \n", topk * 100); if (topk > 0) fprintf(stderr, " Last accuracy TOP%d = %2.2f %% \n", topk_data, topk * 100);
} }
if (net.cudnn_half) { if (net.cudnn_half) {
@ -175,7 +175,7 @@ void train_classifier(char *datacfg, char *cfgfile, char *weightfile, int *gpus,
int draw_precision = 0; int draw_precision = 0;
if (calc_topk && (i >= calc_topk_for_each || i == net.max_batches)) { if (calc_topk && (i >= calc_topk_for_each || i == net.max_batches)) {
iter_topk = i; iter_topk = i;
topk = validate_classifier_single(datacfg, cfgfile, weightfile, &net, topk_data); // calc TOP5 topk = validate_classifier_single(datacfg, cfgfile, weightfile, &net, topk_data); // calc TOP-n
printf("\n accuracy %s = %f \n", topk_buff, topk); printf("\n accuracy %s = %f \n", topk_buff, topk);
draw_precision = 1; draw_precision = 1;
} }

@ -1133,7 +1133,8 @@ void fuse_conv_batchnorm(network net)
{ {
if (l->nweights > 0) { if (l->nweights > 0) {
//cuda_pull_array(l.weights_gpu, l.weights, l.nweights); //cuda_pull_array(l.weights_gpu, l.weights, l.nweights);
for (int i = 0; i < l->nweights; ++i) printf(" w = %f,", l->weights[i]); int i;
for (i = 0; i < l->nweights; ++i) printf(" w = %f,", l->weights[i]);
printf(" l->nweights = %d \n", l->nweights); printf(" l->nweights = %d \n", l->nweights);
} }

Loading…
Cancel
Save