Fixed darknet.py - uses batch=1 by default

This commit is contained in:
AlexeyAB
2018-05-16 15:05:46 +03:00
parent 573d7e8081
commit 89c11f83ed
6 changed files with 30 additions and 5 deletions

View File

@ -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 @@ network *load_network(char *cfg, char *weights, int clear)
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);