Cannot change cost layer's evaluator
Created by: csx008
I need to use paddle.evaluator.precision_recall evaluator in each training pass while default is classification_error. When trying to change cost layer's evaluator, like:
cost = paddle.layer.classification_cost(
input=predict,
label=lbl,
evaluator=paddle.evaluator.precision_recall
)
I get AssertionError:
File "/home/work/MyWorkspace/PaddlePaddle/python27-gcc482/lib/python2.7/site-packages/paddle/v2/config_base.py", line 52, in wrapped
out = f(*args, **xargs)
File "/home/work/MyWorkspace/PaddlePaddle/python27-gcc482/lib/python2.7/site-packages/paddle/trainer_config_helpers/default_decorators.py", line 53, in __wrapper__
return func(*args, **kwargs)
File "/home/work/MyWorkspace/PaddlePaddle/python27-gcc482/lib/python2.7/site-packages/paddle/trainer_config_helpers/layers.py", line 415, in wrapper
return method(*args, **kwargs)
File "/home/work/MyWorkspace/PaddlePaddle/python27-gcc482/lib/python2.7/site-packages/paddle/trainer_config_helpers/layers.py", line 4627, in classification_cost
__add_evaluator__(each_evaluator)
File "/home/work/MyWorkspace/PaddlePaddle/python27-gcc482/lib/python2.7/site-packages/paddle/trainer_config_helpers/layers.py", line 4614, in __add_evaluator__
assert hasattr(e, 'is_evaluator')
And set evaluator to the default classification_error also get this eror. Is my way OK?