fix: flush buffer to weights-file when writing each layer (#7747)

Co-authored-by: Double.c <double.c@inwinstack.com>
This commit is contained in:
Double 2021-06-17 00:25:00 +08:00 committed by GitHub
parent 00b8e29b68
commit 396b5299a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -2026,6 +2026,7 @@ void save_weights_upto(network net, char *filename, int cutoff, int save_ema)
fwrite(l.biases, sizeof(float), l.outputs, fp);
fwrite(l.weights, sizeof(float), size, fp);
}
fflush(fp);
}
fclose(fp);
}