-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
fix the div 0 error of sparse_embedding #49948
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
if input.size == 0: | ||
raise ValueError("input size should not be 0") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个报错是哪里报错的?可以在C++端做检查吗?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Traceback (most recent call last):
File "bug.py", line 6, in <module>
paddle.static.nn.sparse_embedding(input, [2097152, 2097152, 2097152, 2097152], padding_idx=2097152)
File "/home/work/wangying/paddlepaddle/pdpd_fuzz_protobuf/pdpd-env/clang_pd_fuzz_env/lib/python3.8/site-packages/paddle/fluid/contrib/layers/nn.py", line 1205, in sparse_embedding
w = helper.create_parameter(
File "/home/work/wangying/paddlepaddle/pdpd_fuzz_protobuf/pdpd-env/clang_pd_fuzz_env/lib/python3.8/site-packages/paddle/fluid/layer_helper_base.py", line 432, in create_parameter
return self.main_program.global_block().create_parameter(
File "/home/work/wangying/paddlepaddle/pdpd_fuzz_protobuf/pdpd-env/clang_pd_fuzz_env/lib/python3.8/site-packages/paddle/fluid/framework.py", line 3963, in create_parameter
initializer(param, self)
File "/home/work/wangying/paddlepaddle/pdpd_fuzz_protobuf/pdpd-env/clang_pd_fuzz_env/lib/python3.8/site-packages/paddle/fluid/initializer.py", line 72, in __call__
return self.forward(param, block)
File "/home/work/wangying/paddlepaddle/pdpd_fuzz_protobuf/pdpd-env/clang_pd_fuzz_env/lib/python3.8/site-packages/paddle/fluid/initializer.py", line 712, in forward
limit = math.sqrt(6.0 / float(fan_in + fan_out))
ZeroDivisionError: float division by zero
求指路一下c++端文件~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
啊,抱歉,我看了一下报错。这个是python端的错误。只能加在python端。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* fix the div 0 error of sparse_embedding * add unittest
PR types
Bug fixes
PR changes
APIs
Describe