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

There is something wrong during running the demo.py #2

Open
burbage233 opened this issue Apr 4, 2022 · 0 comments
Open

There is something wrong during running the demo.py #2

burbage233 opened this issue Apr 4, 2022 · 0 comments

Comments

@burbage233
Copy link

image
u'春'
此字在语料库中未出现过,请更换首字

Traceback (most recent call last):
File "D:/app/桌面文件/pytorch_pycharm/ChinesePoemGeneration-master-gru/demo.py", line 82, in
poems = infer(model, final, words, word2int, emb, hidden_size = model.hidden_size, start=start, n = 20, num = 5 if random.random() < 0.5 else 7)
File "D:\app\桌面文件\pytorch_pycharm\ChinesePoemGeneration-master-gru\main.py", line 48, in infer
x, h = model(x, h)
File "C:\Users\lenovo.conda\envs\py36\lib\site-packages\torch\nn\modules\module.py", line 1051, in _call_impl
return forward_call(*input, **kwargs)
File "C:\Users\lenovo.conda\envs\py36\lib\site-packages\torch\nn\modules\rnn.py", line 837, in forward
result = _VF.gru(input, hx, self._flat_weights, self.bias, self.num_layers,
File "C:\Users\lenovo.conda\envs\py36\lib\site-packages\torch\nn\modules\module.py", line 1131, in getattr
type(self).name, name))
AttributeError: 'GRU' object has no attribute '_flat_weights'

my pytorch version is 1.9.0

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

1 participant