label_semantic_roles下载完数据后运行train.sh出错
Created by: ArrowLuo
我在docker中运行情感分析understand_sentiment没有出错,但是运行语义角色标注label_semantic_roles时出现如下错误:
Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/paddle/trainer/config_parser.py", line 3406, in parse_config_and_serialize config = parse_config(config_file, config_arg_str) File "/usr/local/lib/python2.7/dist-packages/paddle/trainer/config_parser.py", line 3382, in parse_config execfile(config_file, make_config_environment(config_file, config_args)) File "./db_lstm.py", line 79, in average_window=0.5, max_average_window=10000), ) File "/usr/local/lib/python2.7/dist-packages/paddle/trainer_config_helpers/default_decorators.py", line 53, in wrapper return func(*args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/paddle/trainer_config_helpers/default_decorators.py", line 53, in wrapper return func(*args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/paddle/trainer_config_helpers/optimizers.py", line 441, in settings kwargs = extends(kwargs, each.to_setting_kwargs()) File "/usr/local/lib/python2.7/dist-packages/paddle/trainer_config_helpers/optimizers.py", line 349, in extends assert key not in dict1 AssertionError F0227 09:10:32.580476 869 PythonUtil.cpp:134] Check failed: (ret) != nullptr Current PYTHONPATH: ['/usr/local/opt/paddle/bin', '/home/code/label_semantic_roles', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages'] Python Error:
: Python Callstack: /usr/local/lib/python2.7/dist-packages/paddle/trainer/config_parser.py : 3406 /usr/local/lib/python2.7/dist-packages/paddle/trainer/config_parser.py : 3382 ./db_lstm.py : 79 /usr/local/lib/python2.7/dist-packages/paddle/trainer_config_helpers/default_decorators.py : 53 /usr/local/lib/python2.7/dist-packages/paddle/trainer_config_helpers/default_decorators.py : 53 /usr/local/lib/python2.7/dist-packages/paddle/trainer_config_helpers/optimizers.py : 441 /usr/local/lib/python2.7/dist-packages/paddle/trainer_config_helpers/optimizers.py : 349 Call Object failed. * Check failure stack trace: *
@ 0x7fac2f86edaa (unknown) @ 0x7fac2f86ece4 (unknown) @ 0x7fac2f86e6e6 (unknown) @ 0x7fac2f871687 (unknown) @ 0x813eba paddle::callPythonFuncRetPyObj() @ 0x81409c paddle::callPythonFunc() @ 0x6b1f73 paddle::TrainerConfigHelper::TrainerConfigHelper() @ 0x6b25b4 paddle::TrainerConfigHelper::createFromFlags() @ 0x52b2f7 main @ 0x7fac2ea7af45 (unknown) @ 0x540c05 (unknown) @ (nil) (unknown) /usr/local/bin/paddle: line 109: 869 Aborted (core dumped) ${DEBUGGER} $MYDIR/../opt/paddle/bin/paddle_trainer ${@:2}
第79行代码如下:
model_average=ModelAverage( average_window=0.5, max_average_window=10000), )
我注释掉该行后,报96行:
default_std = 1 / math.sqrt(hidden_dim) / 3.0
sqrt找不到,但是单独在python中运行时没有问题的;
万望指导,谢谢!