mirror of
https://github.com/pjreddie/darknet.git
synced 2023-08-10 21:13:14 +03:00
small bug in forward_network_gpu
This commit is contained in:
parent
fdcc096694
commit
98813ad520
@ -41,9 +41,9 @@ void train_captcha2(char *cfgfile, char *weightfile)
|
|||||||
//net.seen=0;
|
//net.seen=0;
|
||||||
int imgs = 1024;
|
int imgs = 1024;
|
||||||
int i = net.seen/imgs;
|
int i = net.seen/imgs;
|
||||||
int solved = 0;
|
int solved = 1;
|
||||||
list *plist;
|
list *plist;
|
||||||
char **labels = get_labels("/data/captcha/reimgs.labels2.list");
|
char **labels = get_labels("/data/captcha/reimgs.labels.list");
|
||||||
if (solved){
|
if (solved){
|
||||||
plist = get_paths("/data/captcha/reimgs.solved.list");
|
plist = get_paths("/data/captcha/reimgs.solved.list");
|
||||||
}else{
|
}else{
|
||||||
@ -95,7 +95,7 @@ void test_captcha2(char *cfgfile, char *weightfile, char *filename)
|
|||||||
set_batch_network(&net, 1);
|
set_batch_network(&net, 1);
|
||||||
srand(2222222);
|
srand(2222222);
|
||||||
int i = 0;
|
int i = 0;
|
||||||
char **names = get_labels("/data/captcha/reimgs.labels2.list");
|
char **names = get_labels("/data/captcha/reimgs.labels.list");
|
||||||
char input[256];
|
char input[256];
|
||||||
int indexes[26];
|
int indexes[26];
|
||||||
while(1){
|
while(1){
|
||||||
|
@ -47,7 +47,7 @@ void train_imagenet(char *cfgfile, char *weightfile)
|
|||||||
avg_loss = avg_loss*.9 + loss*.1;
|
avg_loss = avg_loss*.9 + loss*.1;
|
||||||
printf("%d: %f, %f avg, %lf seconds, %d images\n", i, loss, avg_loss, sec(clock()-time), net.seen);
|
printf("%d: %f, %f avg, %lf seconds, %d images\n", i, loss, avg_loss, sec(clock()-time), net.seen);
|
||||||
free_data(train);
|
free_data(train);
|
||||||
if((i % 30000) == 0) net.learning_rate *= .1;
|
if((i % 35000) == 0) net.learning_rate *= .1;
|
||||||
if(i%1000==0){
|
if(i%1000==0){
|
||||||
char buff[256];
|
char buff[256];
|
||||||
sprintf(buff, "/home/pjreddie/imagenet_backup/%s_%d.weights",base, i);
|
sprintf(buff, "/home/pjreddie/imagenet_backup/%s_%d.weights",base, i);
|
||||||
|
@ -33,7 +33,7 @@ void forward_network_gpu(network net, network_state state)
|
|||||||
int i;
|
int i;
|
||||||
for(i = 0; i < net.n; ++i){
|
for(i = 0; i < net.n; ++i){
|
||||||
layer l = net.layers[i];
|
layer l = net.layers[i];
|
||||||
if(l.delta){
|
if(l.delta_gpu){
|
||||||
scal_ongpu(l.outputs * l.batch, 0, l.delta_gpu, 1);
|
scal_ongpu(l.outputs * l.batch, 0, l.delta_gpu, 1);
|
||||||
}
|
}
|
||||||
if(l.type == CONVOLUTIONAL){
|
if(l.type == CONVOLUTIONAL){
|
||||||
|
Loading…
Reference in New Issue
Block a user