demo sentiment: wrong parameter act_type
Created by: cactiball
In source code paddle/demo/sentiment/sentiment_net.py, line 67 & 68 are:
output = fc_layer(input=dropout, size=class_dim, act_type=SoftmaxActivation())
Should change "act_type" to "act".
Procedure of getting the bug:
- Uncomment line 39 and comment line 37&38 in paddle/demo/sentiment/trainer_config.py
- run train.sh in this demo, get the error log as follows:
I0902 14:54:12.794140 2965 Util.cpp:144] commandline: /data/paddle_build/bin/../opt/paddle/bin/paddle_trainer --config=trainer_config.py --save_dir=./model_output --job=train --use_gpu=true --trainer_count=4 --num_passes=10 --log_period=10 --dot_period=20 --show_parameter_stats_period=100 --test_all_data_in_one_period=1
I0902 14:54:14.613126 2965 Util.cpp:113] Calling runInitFunctions
I0902 14:54:14.613312 2965 Util.cpp:126] Call runInitFunctions done.
[WARNING 2016-09-02 14:54:14,902 default_decorators.py:40] please use keyword arguments in paddle config.
[WARNING 2016-09-02 14:54:14,903 default_decorators.py:40] please use keyword arguments in paddle config.
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/paddle-0.8.0b-py2.7.egg/paddle/trainer/config_parser.py", line 3113, in parse_config_and_serialize
config = parse_config(config_file, config_arg_str)
File "/usr/local/lib/python2.7/dist-packages/paddle-0.8.0b-py2.7.egg/paddle/trainer/config_parser.py", line 3089, in parse_config
execfile(config_file, make_config_environment(config_file, config_args))
File "trainer_config.py", line 39, in
bidirectional_lstm_net(dict_dim, class_dim=class_dim, is_predict=is_predict)
File "/data/cactiball/paddle/demo/sentiment/sentiment_net.py", line 68, in bidirectional_lstm_net
act_type=SoftmaxActivation())
File "/usr/local/lib/python2.7/dist-packages/paddle-0.8.0b-py2.7.egg/paddle/trainer_config_helpers/default_decorators.py", line 45, in wrapper
return func(_args, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/paddle-0.8.0b-py2.7.egg/paddle/trainer_config_helpers/default_decorators.py", line 45, in wrapper
return func(_args, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/paddle-0.8.0b-py2.7.egg/paddle/trainer_config_helpers/default_decorators.py", line 45, in wrapper
return func(_args, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/paddle-0.8.0b-py2.7.egg/paddle/trainer_config_helpers/default_decorators.py", line 45, in wrapper
return func(_args, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/paddle-0.8.0b-py2.7.egg/paddle/trainer_config_helpers/layers.py", line 219, in wrapper
return method(_args, *_kwargs)
TypeError: fc_layer() got an unexpected keyword argument 'act_type'
F0902 14:54:14.905133 2965 PythonUtil.cpp:130] Check failed: (ret) != nullptr Python Error: * Check failure stack trace: *
@ 0x7f6febce7daa (unknown)
@ 0x7f6febce7ce4 (unknown)
@ 0x7f6febce76e6 (unknown)
@ 0x7f6febcea687 (unknown)
@ 0x82f6d7 paddle::callPythonFuncRetPyObj()
@ 0x82fa3c paddle::callPythonFunc()
@ 0x6a8173 paddle::TrainerConfigHelper::TrainerConfigHelper()
@ 0x6a87b4 paddle::TrainerConfigHelper::createFromFlags()
@ 0x53af73 main
@ 0x7f6feaef3ec5 (unknown)
@ 0x5466b5 (unknown)
@ (nil) (unknown)
/data/paddle_build/bin/paddle: line 46: 2965 Aborted (core d