ラズベリーパイのシナプスマネージャーからFANN(Fast artificial neural network)ライブラリーをダウンロードしました。私は、以下に示すように、デフォルトのアプリケーションを実行しようとしています:ラズベリーパイ3、fann_create_standardが定義されていません
#include "fann.h"
#include "floatfann.h"
include "fann_data.h"
int main()
{
const unsigned int num_input = 2;
const unsigned int num_output = 1;
const unsigned int num_layers = 3;
const unsigned int num_neurons_hidden = 3;
const float desired_error = (const float) 0.001;
const unsigned int max_epochs = 500000;
const unsigned int epochs_between_reports = 1000;
struct fann *ann = fann_create_standard(num_layers, num_input,
num_neurons_hidden, num_output);
fann_set_activation_function_hidden(ann, FANN_SIGMOID_SYMMETRIC);
fann_set_activation_function_output(ann, FANN_SIGMOID_SYMMETRIC);
fann_train_on_file(ann, "xor.data", max_epochs,
epochs_between_reports, desired_error);
fann_save(ann, "xor_float.net");
fann_destroy(ann);
return 0;
}
私はこの出力を取得しています:以下のように
enter code here
||=== Build: Debug in ArtificialNeuralNetworkExample (compiler: GNU GCC Compi ler) ===|
obj/Debug/main.o||In function `main':|
/home/pi/Documents/ArtificialNeuralNetworkExample/main.c|14|undefined reference to `fann_create_standard'|
/home/pi/Documents/ArtificialNeuralNetworkExample/main.c|17|undefined reference to `fann_set_activation_function_hidden'|
/home/pi/Documents/ArtificialNeuralNetworkExample/main.c|18|undefined reference to `fann_set_activation_function_output'|
/home/pi/Documents/ArtificialNeuralNetworkExample/main.c|20|undefined reference to `fann_train_on_file'|
/home/pi/Documents/ArtificialNeuralNetworkExample/main.c|23|undefined reference to `fann_save'|
/home/pi/Documents/ArtificialNeuralNetworkExample/main.c|25|undefined reference to `fann_destroy'|
||=== Build failed: 6 error(s), 0 warning(s) (0 minute(s), 1 second(s)) ===|
もgcc
を使用してライブラリをリンクしてみました:
gcc -lfann main.c
ありません何をすべきか確かめてください。
バージョンで使用されているように、あなたが同様のシナリオに直面している、あなたのケースのために、ライブラリが
main.c
後に表示されることができます場合は2.1.0です。 – Jon私はこれをしましたが、端末から出力が得られません – Jon
Nvm、それを得ました。出力のために./a.outを入力する必要がありました – Jon