自己配置网络运行出core
Created by: AoZhang
成功安装后可以跑通quick_start,但是尝试自己配置网络结构、跑quick_start的数据时出core。
无embedding层的时候,
data -> fc_layer -> fc_layer -> output
是可以跑成功的。
加入embedding层后,
data -> emb -> fc_layer -> output
训练会出core,日志如下:
I1124 15:22:31.418560 11872 Util.cpp:155] commandline: /path/to/paddle/output/bin/../opt/paddle/bin/paddle_trainer --config trainer_config.me.py --use_gpu=false --log_period=20 --save_dir=./output.me.emb --num_passes=15
I1124 15:22:31.418912 11872 Util.cpp:130] Calling runInitFunctions
I1124 15:22:31.419441 11872 Util.cpp:143] Call runInitFunctions done.
[INFO 2016-11-24 15:22:31,799 networks.py:1145] The input order is [word, label]
[INFO 2016-11-24 15:22:31,799 networks.py:1152] The output order is [__cost_0__]
I1124 15:22:31.817416 11872 Trainer.cpp:170] trainer mode: Normal
I1124 15:22:31.941279 11872 PyDataProvider2.cpp:257] loading dataprovider dataprovider_emb::process
I1124 15:22:31.974423 11872 PyDataProvider2.cpp:257] loading dataprovider dataprovider_emb::process
I1124 15:22:31.974829 11872 GradientMachine.cpp:134] Initing parameters..
I1124 15:22:32.173585 11872 GradientMachine.cpp:141] Init parameters done.
I1124 15:23:15.201149 11880 ThreadLocal.cpp:37] thread use undeterministic rand seed:11881
F1124 15:23:15.350517 11872 Matrix.cpp:2813] Check failed: label.getSize() == numSamples (128 vs. 17976)
*** Check failure stack trace: ***
@ 0xec7d7c google::LogMessage::Fail()
@ 0xec7cd4 google::LogMessage::SendToLog()
@ 0xec7769 google::LogMessage::Flush()
@ 0xeca52a google::LogMessageFatal::~LogMessageFatal()
@ 0x810cb5 paddle::CpuMatrix::oneHotCrossEntropy()
@ 0x63f0c5 paddle::CostLayer::forward()
@ 0x6d6064 paddle::NeuralNetwork::forward()
@ 0x5d4853 paddle::GradientMachine::forwardBackward()
@ 0x749683 paddle::TrainerInternal::forwardBackwardBatch()
@ 0x74a038 paddle::TrainerInternal::trainOneBatch()
@ 0x744f2f paddle::Trainer::trainOnePass()
@ 0x748807 paddle::Trainer::train()
@ 0x58ec16 main
@ 0x7f4c77974bd5 __libc_start_main
@ 0x59ad49 (unknown)
/path/to/paddle/output/bin/paddle: line 81: 11872 Aborted (core dumped) ${DEBUGGER} $MYDIR/../opt/paddle/bin/paddle_trainer ${@:2}
网络配置代码如下:
bias_attr = ParamAttr(initial_std=0.,l2_rate=0.)
data = data_layer(name="word", size=len(word_dict))
emb = embedding_layer(input=data, size=64)
#pool = pooling_layer(input=emb, pooling_type=AvgPooling())
fc = fc_layer(input=emb, size=256, act=LinearActivation(),
bias_attr=bias_attr,
layer_attr=ExtraAttr(drop_rate=0.1))
output = fc_layer(input=fc, size=2, act=SoftmaxActivation())
在fc_layer之前或之后加入一个pooling_layer都可以解决出core的问题,能帮忙解释一下吗?谢谢!