NELSONZHAO / zhihu

This repo contains the source code in my personal column (https://zhuanlan.zhihu.com/zhaoyeyu), implemented using Python 3.6. Including Natural Language Processing and Computer Vision projects, such as text generation, machine translation, deep convolution GAN and other actual combat code.
https://zhuanlan.zhihu.com/zhaoyeyu
3.5k stars 2.14k forks source link

在generate_lyric工程中,生成报错如下,probabilities的格式为(1,1,11143),是不是前面哪里有问题,probabilities的格式应该是有问题的 #17

Open tryinggo opened 6 years ago

tryinggo commented 6 years ago

File "/media/a/000DD2E00004710E/generate_lyrics/generate_lyrics.py", line 292, in print(probabilities[dyn_seq_length - 1]) IndexError: index 1 is out of bounds for axis 0 with size 1

tryinggo commented 6 years ago

已经解决: pred_word = pick_word(probabilities[0][dyn_seq_length - 1], int_to_vocab)