ChinesePoemGeneration icon indicating copy to clipboard operation
ChinesePoemGeneration copied to clipboard

There is something wrong during running the demo.py

Open burbage233 opened this issue 2 years ago • 0 comments

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

burbage233 avatar Apr 04 '22 05:04 burbage233