在给定列表的情况下创建 ANN 时 FANNJ 崩溃
FANNJ is crashing when creating an ANN given a list
FANNJ 的构造函数接受给出层列表的方式,但是当我尝试构建一个具有 2 层的简单 ANN 时,编译器崩溃了
Layer lhidden1 = new Layer();
lhidden1.create(num_neurons_hidden, ActivationFunction.FANN_SIGMOID_SYMMETRIC_STEPWISE);
Layer loutput = new Layer();
loutput.create(num_neurons_output, ActivationFunction.FANN_SIGMOID_STEPWISE);
List<Layer> list = new ArrayList<Layer>();
list.add(lhidden1);
list.add(loutput);
fann = new Fann(list);
程序在"fann = new Fann(list)"命令处停止。听起来与 "fann_create_sparse_array" 有关,它被指向 "Problematic frame":
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGFPE (0x8) at pc=0x00007f2f7b3434c6, pid=6926, tid=0x00007f2f992ed700
#
# JRE version: OpenJDK Runtime Environment (8.0_131-b11) (build 1.8.0_131-8u131-b11-1~bpo8+1-b11)
# Java VM: OpenJDK 64-Bit Server VM (25.131-b11 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C [libfann.so+0x54c6] fann_create_sparse_array+0x2ca
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
查了ulimit,不过只是dump error configuration,听上去解决不了任何问题,只是为了让大家多了解一下crash。有谁知道怎么解决吗?
简单汇报一下解决方法:create方法必须静态访问,所以解决方法应该是这样的:
List<Layer> list = new ArrayList<Layer>();
list.add(Layer.create(num_neurons_hidden, ActivationFunction.FANN_SIGMOID_SYMMETRIC_STEPWISE));
list.add(Layer.create(num_neurons_output, ActivationFunction.FANN_SIGMOID_STEPWISE));
Fann fann = new Fann(list);
FANNJ 的构造函数接受给出层列表的方式,但是当我尝试构建一个具有 2 层的简单 ANN 时,编译器崩溃了
Layer lhidden1 = new Layer();
lhidden1.create(num_neurons_hidden, ActivationFunction.FANN_SIGMOID_SYMMETRIC_STEPWISE);
Layer loutput = new Layer();
loutput.create(num_neurons_output, ActivationFunction.FANN_SIGMOID_STEPWISE);
List<Layer> list = new ArrayList<Layer>();
list.add(lhidden1);
list.add(loutput);
fann = new Fann(list);
程序在"fann = new Fann(list)"命令处停止。听起来与 "fann_create_sparse_array" 有关,它被指向 "Problematic frame":
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGFPE (0x8) at pc=0x00007f2f7b3434c6, pid=6926, tid=0x00007f2f992ed700
#
# JRE version: OpenJDK Runtime Environment (8.0_131-b11) (build 1.8.0_131-8u131-b11-1~bpo8+1-b11)
# Java VM: OpenJDK 64-Bit Server VM (25.131-b11 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C [libfann.so+0x54c6] fann_create_sparse_array+0x2ca
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
查了ulimit,不过只是dump error configuration,听上去解决不了任何问题,只是为了让大家多了解一下crash。有谁知道怎么解决吗?
简单汇报一下解决方法:create方法必须静态访问,所以解决方法应该是这样的:
List<Layer> list = new ArrayList<Layer>();
list.add(Layer.create(num_neurons_hidden, ActivationFunction.FANN_SIGMOID_SYMMETRIC_STEPWISE));
list.add(Layer.create(num_neurons_output, ActivationFunction.FANN_SIGMOID_STEPWISE));
Fann fann = new Fann(list);