mirror of
https://github.com/pjreddie/darknet.git
synced 2023-08-10 21:13:14 +03:00
🌃 🤔 💭 👹
This commit is contained in:
parent
56be49aa48
commit
80d9bec20f
@ -47,7 +47,7 @@ void optimize_picture(network *net, image orig, int max_layer, float scale, floa
|
|||||||
|
|
||||||
#ifdef GPU
|
#ifdef GPU
|
||||||
net->delta_gpu = cuda_make_array(delta.data, im.w*im.h*im.c);
|
net->delta_gpu = cuda_make_array(delta.data, im.w*im.h*im.c);
|
||||||
cuda_push_array(net->input_gpu, im.data, net->inputs);
|
copy_cpu(net->inputs, im.data, 1, net->input, 1);
|
||||||
|
|
||||||
forward_network_gpu(net);
|
forward_network_gpu(net);
|
||||||
copy_gpu(last.outputs, last.output_gpu, 1, last.delta_gpu, 1);
|
copy_gpu(last.outputs, last.output_gpu, 1, last.delta_gpu, 1);
|
||||||
@ -62,6 +62,7 @@ void optimize_picture(network *net, image orig, int max_layer, float scale, floa
|
|||||||
cuda_free(net->delta_gpu);
|
cuda_free(net->delta_gpu);
|
||||||
net->delta_gpu = 0;
|
net->delta_gpu = 0;
|
||||||
#else
|
#else
|
||||||
|
printf("\nnet: %d %d %d im: %d %d %d\n", net->w, net->h, net->inputs, im.w, im.h, im.c);
|
||||||
copy_cpu(net->inputs, im.data, 1, net->input, 1);
|
copy_cpu(net->inputs, im.data, 1, net->input, 1);
|
||||||
net->delta = delta.data;
|
net->delta = delta.data;
|
||||||
forward_network(net);
|
forward_network(net);
|
||||||
@ -308,8 +309,7 @@ void run_nightmare(int argc, char **argv)
|
|||||||
int reconstruct = find_arg(argc, argv, "-reconstruct");
|
int reconstruct = find_arg(argc, argv, "-reconstruct");
|
||||||
int smooth_size = find_int_arg(argc, argv, "-smooth", 1);
|
int smooth_size = find_int_arg(argc, argv, "-smooth", 1);
|
||||||
|
|
||||||
network *net = parse_network_cfg(cfg);
|
network *net = load_network(cfg, weights, 0);
|
||||||
load_weights(net, weights);
|
|
||||||
char *cfgbase = basecfg(cfg);
|
char *cfgbase = basecfg(cfg);
|
||||||
char *imbase = basecfg(input);
|
char *imbase = basecfg(input);
|
||||||
|
|
||||||
|
@ -177,7 +177,7 @@ void backward_convolutional_layer_gpu(convolutional_layer l, network net)
|
|||||||
if(l.smooth){
|
if(l.smooth){
|
||||||
smooth_layer(l, 5, l.smooth);
|
smooth_layer(l, 5, l.smooth);
|
||||||
}
|
}
|
||||||
constrain_gpu(l.outputs*l.batch, 1, l.delta_gpu, 1);
|
//constrain_gpu(l.outputs*l.batch, 1, l.delta_gpu, 1);
|
||||||
gradient_array_gpu(l.output_gpu, l.outputs*l.batch, l.activation, l.delta_gpu);
|
gradient_array_gpu(l.output_gpu, l.outputs*l.batch, l.activation, l.delta_gpu);
|
||||||
|
|
||||||
|
|
||||||
|
@ -1110,7 +1110,7 @@ void load_weights_upto(network *net, char *filename, int start, int cutoff)
|
|||||||
fread(&major, sizeof(int), 1, fp);
|
fread(&major, sizeof(int), 1, fp);
|
||||||
fread(&minor, sizeof(int), 1, fp);
|
fread(&minor, sizeof(int), 1, fp);
|
||||||
fread(&revision, sizeof(int), 1, fp);
|
fread(&revision, sizeof(int), 1, fp);
|
||||||
if ((major*10 + minor) >= 2){
|
if ((major*10 + minor) >= 2 && major < 1000 && minor < 1000){
|
||||||
fread(net->seen, sizeof(size_t), 1, fp);
|
fread(net->seen, sizeof(size_t), 1, fp);
|
||||||
} else {
|
} else {
|
||||||
int iseen = 0;
|
int iseen = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user