問題タブ [fann]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
c++ - FANN: 複数のファイルから読み取ったデータを使用して ANN をトレーニングするとメモリ リークが発生する
次のループがあります。
ann
ネットワークです。
batchFiles
ですstd::vector<std::filesystem::path>
。
このコードは、フォルダー内のすべてのトレーニング データ ファイルを反復処理し、それを使用して毎回、epochs
変数によって決定される回数だけ ANN をトレーニングします。
次の行により、メモリ リークが発生します。
struct fann_train_data *data = fann_read_train_from_file(it->string().c_str());
問題は、一度にすべてをロードするのに十分なメモリがないため、トレーニング ファイルを常に切り替える必要があることです。そうしないと、トレーニング データを 1 回だけロードしたことになります。
なぜこれが起こるのですか?どうすればこれを解決できますか?