PaddlePaddle / Paddle

PArallel Distributed Deep LEarning: Machine Learning Framework from Industrial Practice (『飞桨』核心框架,深度学习&机器学习高性能单机、分布式训练和跨平台部署)
http://www.paddlepaddle.org/
Apache License 2.0
22.24k stars 5.59k forks source link

[semantic_role_labeling]在train的时候,调用对象失败 #820

Closed beckett1124 closed 7 years ago

beckett1124 commented 7 years ago

[semantic_role_labeling]在train的时候,调用对象失败。

root@aaef91eb6282:~/paddle/demo/semantic_role_labeling# ./train.sh
I1212 02:06:25.270638 4075 Util.cpp:158] commandline: /usr/local/bin/../opt/paddle/bin/paddle_trainer --config=./db_lstm.py --use_gpu=1 --log_period=10 --trainer_count=1 --show_parameter_stats_period=10 --save_dir=./output --num_passes=50 --average_test_period=1000 --init_model_path=./data --load_missing_parameter_strategy=rand --test_all_data_in_one_period=1 I1212 02:06:27.837712 4075 Util.cpp:132] Calling runInitFunctions I1212 02:06:27.838145 4075 Util.cpp:146] Call runInitFunctions done. Traceback (most recent call last): File "", line 13, in NameError: name 'GLOG_logtostderr' is not defined Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/paddle/trainer/config_parser.py", line 3417, in parse_config_and_serialize 6n config = parse_config(config_file, config_arg_str) File "/usr/local/lib/python2.7/dist-packages/paddle/trainer/config_parser.py", line 3393, in parse_config execfile(config_file, make_config_environment(config_file, config_args)) File "./db_lstm.py", line 92, in max_average_window=100), 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 F1212 02:06:28.072757 4075 PythonUtil.cpp:131] Check failed: (ret) != nullptr Current PYTHONPATH: ['/usr/local/opt/paddle/bin', '/root/paddle/demo/semantic_role_labeling', '/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', '/usr/lib/python2.7/dist-packages/PILcompat', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/pymodules/python2.7'] Python Error: <type 'exceptions.AssertionError'> : Python Callstack: /usr/local/lib/python2.7/dist-packages/paddle/trainer/config_parser.py : 3417 /usr/local/lib/python2.7/dist-packages/paddle/trainer/config_parser.py : 3393 ./db_lstm.py : 92 /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: *** @ 0x7fa65c232daa (unknown) @ 0x7fa65c232ce4 (unknown) @ 0x7fa65c2326e6 (unknown) @ 0x7fa65c235687 (unknown) @ 0x81f83a paddle::callPythonFuncRetPyObj() @ 0x81fa1c paddle::callPythonFunc() @ 0x6bbf83 paddle::TrainerConfigHelper::TrainerConfigHelper() @ 0x6bc5c4 paddle::TrainerConfigHelper::createFromFlags() @ 0x534827 main @ 0x7fa65b43ef45 (unknown) @ 0x54a762 (unknown) @ (nil) (unknown) /usr/local/bin/paddle: line 111: 4075 Aborted ${DEBUGGER} $MYDIR/../opt/paddle/bin/paddle_trainer ${@:2}

qingqing01 commented 7 years ago

请问您使用的执行环境是什么、paddle版本什么呢?不太确定是不是paddle版本和demo版本是否一致, demo后来有更新,所以最好使用统一的版本的~

zhangjcqq commented 7 years ago

Paddle/python/paddle/trainer_config_helpers/optimizers.py, line 349, 注释掉,再试试,应该就可以了。我认为是个代码bug。

zhangjcqq commented 7 years ago

db_lstm.py line 15: import math -->from math import sqrt line 116: math.sqrt -->sqrt