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

LSTM禁用偏置项,就会导致程序无法运行 #70231

Open
sealoongleft opened this issue Dec 15, 2024 · 2 comments
Open

LSTM禁用偏置项,就会导致程序无法运行 #70231

sealoongleft opened this issue Dec 15, 2024 · 2 comments
Assignees

Comments

@sealoongleft
Copy link

sealoongleft commented Dec 15, 2024

bug描述 Describe the Bug

description:代码本身可以正常运行,但是我添加bias_hh_attr=False,bias_ih_attr=False后代码就报错了,这个想不明白为何禁用偏执导致程序运行失败呢?太奇怪了…… (代码是在3.0beta上进行的,我刚刚又测试了2.2版本的此api就没有该问题,我应该是发现了3.0beta版本的一个小bug).

代码很简单如下所示:

import paddle
import paddle.nn as nn

paddle.seed(0)
lstm=nn.LSTM(input_size=2,hidden_size=2,num_layers=1,dropout=0,proj_size=0)
#在上一行添加bias_hh_attr=False,bias_ih_attr=False就会导致无法运行。
data=paddle.randint(0,3,(1,1,2))*1.0
print(lstm(data))

其他补充信息 Additional Supplementary Information

  • win11操作系统
  • 其余使用的都是当前的paddle-gpu的最新版。
@zxcd
Copy link
Contributor

zxcd commented Dec 16, 2024

develop version is worked with
lstm=nn.LSTM(input_size=2,hidden_size=2,num_layers=1,dropout=0,proj_size=0, bias_hh_attr=None, bias_ih_attr=None)

image

@sealoongleft
Copy link
Author

多谢大佬,那个develop version我就没尝试,我以为还不如3。0 beta版本呢

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

No branches or pull requests

3 participants