Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unexpected keyword argument 'top_k' #2574

Closed
Damon-wyg opened this issue Jun 23, 2017 · 1 comment
Closed

unexpected keyword argument 'top_k' #2574

Damon-wyg opened this issue Jun 23, 2017 · 1 comment
Assignees

Comments

@Damon-wyg
Copy link

Damon-wyg commented Jun 23, 2017

网络里并没有写过top_k,但是一直报top_k参数错误

F0623 09:15:01.814636 27241 PythonUtil.cpp:131] Check failed: (ret) != nullptr Current PYTHONPATH: ['/home/disk1/normandy/maybach/38769/workspace', '/home/disk1/normandy/maybach/38769/workspace/python27-gcc482/lib/python2.7/site-packages/setuptools-18.2-py2.7.egg', '/home/disk1/normandy/maybach/38769/workspace/paddle', '/home/disk1/normandy/maybach/38769/workspace', '/home/disk1/normandy/maybach/38769/workspace/thirdparty/thirdparty', '/home/disk1/normandy/maybach/38769/workspace/python27-gcc482/lib/python27.zip', '/home/disk1/normandy/maybach/38769/workspace/python27-gcc482/lib/python2.7', '/home/disk1/normandy/maybach/38769/workspace/python27-gcc482/lib/python2.7/plat-linux2', '/home/disk1/normandy/maybach/38769/workspace/python27-gcc482/lib/python2.7/lib-tk', '/home/disk1/normandy/maybach/38769/workspace/python27-gcc482/lib/python2.7/lib-old', '/home/disk1/normandy/maybach/38769/workspace/python27-gcc482/lib/python2.7/lib-dynload', '/home/disk1/normandy/maybach/38769/workspace/python27-gcc482/lib/python2.7/site-packages']
Python Error: <type 'exceptions.TypeError'> : precision_recall_evaluator() got an unexpected keyword argument 'top_k'
Python Callstack: 
            /home/disk1/normandy/maybach/38769/workspace/python27-gcc482/lib/python2.7/site-packages/paddle/trainer/config_parser.py : 3607
            /home/disk1/normandy/maybach/38769/workspace/python27-gcc482/lib/python2.7/site-packages/paddle/trainer/config_parser.py : 3600
            conf/trainer_config.conf : 99
            /home/disk1/normandy/maybach/38769/workspace/python27-gcc482/lib/python2.7/site-packages/paddle/trainer_config_helpers/default_decorators.py : 53
            /home/disk1/normandy/maybach/38769/workspace/python27-gcc482/lib/python2.7/site-packages/paddle/trainer_config_helpers/layers.py : 329
            /home/disk1/normandy/maybach/38769/workspace/python27-gcc482/lib/python2.7/site-packages/paddle/trainer_config_helpers/layers.py : 3850
            /home/disk1/normandy/maybach/38769/workspace/python27-gcc482/lib/python2.7/site-packages/paddle/trainer_config_helpers/layers.py : 3844
            /home/disk1/normandy/maybach/38769/workspace/python27-gcc482/lib/python2.7/site-packages/paddle/trainer_config_helpers/default_decorators.py : 53
Call Object failed.
Path	URL	2.39KB	
@qingqing01
Copy link
Contributor

qingqing01 commented Jun 23, 2017

You use classification_cost as follows:

cls = classification_cost(input=out_layer, label=label, evaluator=[precision_recall_evaluator])

As @lcy-seso said, this problem had been fixed in PR. But the paddle version in the cluster has not been updated yet.

But you can use another method:

cost= cross_entropy(out_layer, label)
eval=precision_recall_evaluator(out_layer, label)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants