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

dcn添加偏置,出现Nan错误 #3146

Open
lijun900302 opened this issue Aug 20, 2019 · 3 comments
Open

dcn添加偏置,出现Nan错误 #3146

lijun900302 opened this issue Aug 20, 2019 · 3 comments
Labels

Comments

@lijun900302
Copy link

lijun900302 commented Aug 20, 2019

_**paddle.fluid.core.EnforceNotMet:**_ Invoke operator auc error.

Python Callstacks:
File "/usr/lib64/python2.7/site-packages/paddle/fluid/framework.py", line 1712, in append_op
attrs=kwargs.get("attrs", None))
File "/usr/lib64/python2.7/site-packages/paddle/fluid/layer_helper.py", line 43, in append_op
return self.main_program.current_block().append_op(*args, **kwargs)
File "/usr/lib64/python2.7/site-packages/paddle/fluid/layers/metric_op.py", line 172, in auc
"StatNegOut": [batch_stat_neg]
File "dcn1.py", line 221, in ctr_wide_deep_model
auc_var, batch_auc_var, auc_states = fluid.layers.auc(input=predict, label=label)
File "dcn1.py", line 238, in train
datas, predict, loss, auc, auc_batch = ctr_wide_deep_model()
File "dcn1.py", line 369, in
train()
C++ Callstacks:
Enforce failed. Expected predict_data <= 1, but received predict_data:-nan > 1:1.
The predict data must less or equal 1. at [/home/amy/eason/install/Paddle/paddle/fluid/operators/metrics/auc_op.h:80]
PaddlePaddle Call Stacks:

@lijun900302 lijun900302 changed the title dcn添加偏置,出现None错误 dcn添加偏置,出现Nan错误 Aug 20, 2019
@wanghaoshuang
Copy link
Contributor

wanghaoshuang commented Aug 20, 2019

建议您通过在网络中插入Print op定位出现异常的具体某一层。另外,出现NAN也有可能是脏数据导致的。

@mmglove
Copy link
Contributor

mmglove commented Aug 26, 2019

请问这个代码是哪个库下面的,有链接吗?

@lijun900302
Copy link
Author

请问这个代码是哪个库下面的,有链接吗?
写的dcn, 这里面出现Nan,换个优化算法,又可以跑了
def cross_network(x0,slot_num):
xl=x0
for l in range(cross_layers):
x0_1 = paddle.fluid.layers.unsqueeze(x0, [2], name=None)
xl_1 = paddle.fluid.layers.unsqueeze(xl, [2], name=None)
w = paddle.fluid.layers.create_parameter(shape=[slot_num*(g_embedding_size),1],
dtype='float32', name="w")
xw = paddle.fluid.layers.matmul(xl_1,w,transpose_x=True)
xl_xw = paddle.fluid.layers.matmul(x0_1, xw)
xl_1 = fluid.layers.reshape(xl_xw, shape=[-1, slot_num*(g_embedding_size)], name='flatten1')
xl = xl_1 + xl
bias = paddle.fluid.layers.create_parameter([slot_num*(g_embedding_size)], dtype='float32', name="bias")
xl = xl+bias

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

No branches or pull requests

3 participants