mirror of https://github.com/AlexeyAB/darknet.git
Fixed memory release
This commit is contained in:
parent
51477ab274
commit
576dbe12e6
|
@ -595,11 +595,14 @@ void free_network(network net)
|
||||||
free_layer(net.layers[i]);
|
free_layer(net.layers[i]);
|
||||||
}
|
}
|
||||||
free(net.layers);
|
free(net.layers);
|
||||||
free(net.workspace);
|
|
||||||
#ifdef GPU
|
#ifdef GPU
|
||||||
|
if (gpu_index >= 0) cuda_free(net.workspace);
|
||||||
|
else free(net.workspace);
|
||||||
if (*net.input_gpu) cuda_free(*net.input_gpu);
|
if (*net.input_gpu) cuda_free(*net.input_gpu);
|
||||||
if (*net.truth_gpu) cuda_free(*net.truth_gpu);
|
if (*net.truth_gpu) cuda_free(*net.truth_gpu);
|
||||||
if (net.input_gpu) free(net.input_gpu);
|
if (net.input_gpu) free(net.input_gpu);
|
||||||
if (net.truth_gpu) free(net.truth_gpu);
|
if (net.truth_gpu) free(net.truth_gpu);
|
||||||
|
#else
|
||||||
|
free(net.workspace);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue