AlexeyAB
2018-05-23 eef9f8e5bb9fdbe22c6301a56f12e315f9ac64d9
src/network.c
@@ -30,11 +30,11 @@
#include "yolo_layer.h"
#include "parser.h"
network *load_network(char *cfg, char *weights, int clear)
network *load_network_custom(char *cfg, char *weights, int clear, int batch)
{
   printf(" Try to load cfg: %s, weights: %s, clear = %d \n", cfg, weights, clear);
   network *net = calloc(1, sizeof(network));
   *net = parse_network_cfg(cfg);
   *net = parse_network_cfg_custom(cfg, batch);
   if (weights && weights[0] != 0) {
      load_weights(net, weights);
   }
@@ -42,6 +42,11 @@
   return net;
}
network *load_network(char *cfg, char *weights, int clear)
{
   return load_network_custom(cfg, weights, clear, 0);
}
int get_current_batch(network net)
{
    int batch_num = (*net.seen)/(net.batch*net.subdivisions);
@@ -172,7 +177,7 @@
    net.n = n;
    net.layers = calloc(net.n, sizeof(layer));
    net.seen = calloc(1, sizeof(int));
    #ifdef GPU
#ifdef GPU
    net.input_gpu = calloc(1, sizeof(float *));
    net.truth_gpu = calloc(1, sizeof(float *));
@@ -180,7 +185,7 @@
   net.output16_gpu = calloc(1, sizeof(float *));
   net.max_input16_size = calloc(1, sizeof(size_t));
   net.max_output16_size = calloc(1, sizeof(size_t));
    #endif
#endif
    return net;
}