Disable burn_in for FP16 Tensor Cores

This commit is contained in:
AlexeyAB
2018-04-15 16:57:05 +03:00
parent 5c1e8e3f48
commit 6aa140b3c6
3 changed files with 6 additions and 3 deletions

View File

@ -144,11 +144,11 @@ void demo(char *cfgfile, char *weightfile, float thresh, float hier_thresh, int
demo_classes = classes; demo_classes = classes;
demo_thresh = thresh; demo_thresh = thresh;
printf("Demo\n"); printf("Demo\n");
net = parse_network_cfg_custom(cfgfile, 1); net = parse_network_cfg_custom(cfgfile, 1); // set batch=1
if(weightfile){ if(weightfile){
load_weights(&net, weightfile); load_weights(&net, weightfile);
} }
set_batch_network(&net, 1); //set_batch_network(&net, 1);
fuse_conv_batchnorm(net); fuse_conv_batchnorm(net);
srand(2222222); srand(2222222);

View File

@ -167,7 +167,7 @@ void train_detector(char *datacfg, char *cfgfile, char *weightfile, int *gpus, i
#else #else
loss = train_network(net, train); loss = train_network(net, train);
#endif #endif
if (avg_loss < 0) avg_loss = loss; if (avg_loss < 0 || avg_loss != avg_loss) avg_loss = loss; // if(-inf or nan)
avg_loss = avg_loss*.9 + loss*.1; avg_loss = avg_loss*.9 + loss*.1;
i = get_current_batch(net); i = get_current_batch(net);

View File

@ -636,6 +636,9 @@ void parse_net_options(list *options, network *net)
char *policy_s = option_find_str(options, "policy", "constant"); char *policy_s = option_find_str(options, "policy", "constant");
net->policy = get_policy(policy_s); net->policy = get_policy(policy_s);
net->burn_in = option_find_int_quiet(options, "burn_in", 0); net->burn_in = option_find_int_quiet(options, "burn_in", 0);
#ifdef CUDNN_HALF
net->burn_in = 0;
#endif
if(net->policy == STEP){ if(net->policy == STEP){
net->step = option_find_int(options, "step", 1); net->step = option_find_int(options, "step", 1);
net->scale = option_find_float(options, "scale", 1); net->scale = option_find_float(options, "scale", 1);