mirror of
https://github.com/augustin64/projet-tipe
synced 2025-01-23 23:26:25 +01:00
Fix dataset memory leak
This commit is contained in:
parent
df48b92cf2
commit
771d69af20
@ -288,11 +288,26 @@ void train(int dataset_type, char* images_file, char* labels_file, char* data_di
|
||||
}
|
||||
free(shuffle_index);
|
||||
free_network(network);
|
||||
|
||||
#ifdef USE_MULTITHREADING
|
||||
free(tid);
|
||||
#else
|
||||
free(train_params);
|
||||
#endif
|
||||
|
||||
if (dataset_type == 0) {
|
||||
for (int i=0; i < nb_images_total; i++) {
|
||||
for (int j=0; j < 28; j++) {
|
||||
free(images[i][j]);
|
||||
}
|
||||
free(images[i]);
|
||||
}
|
||||
free(images);
|
||||
free(labels);
|
||||
} else {
|
||||
free_dataset(dataset);
|
||||
}
|
||||
|
||||
end_time = omp_get_wtime();
|
||||
elapsed_time = end_time - algo_start;
|
||||
printf("\nTemps total: %0.1f s\n", elapsed_time);
|
||||
|
Loading…
Reference in New Issue
Block a user