poetrys = [[ix2word[_word] for _word in data_[:, _iii].tolist()] for _iii in range(data_.shape[1])][:16]
在运行一次的时候是可以的,但是
18it [00:01, 14.47it/s]> /home/zbp/Linux/tjj/pytorchtest/chapter9-神经网络写诗(CharRNN)/main.py(177)train()
176 ipdb.set_trace()
--> 177 poetrys = [[ix2word[_word] for _word in data_[:, _iii].tolist()] for _iii in range(data_.shape[1])][:16]
178 vis.text('</br>'.join([''.join(poetry) for poetry in poetrys]), win=u'origin_poem')
ipdb> n
> /home/zbp/Linux/tjj/pytorchtest/chapter9-神经网络写诗(CharRNN)/main.py(178)train()
177 poetrys = [[ix2word[_word] for _word in data_[:, _iii].tolist()] for _iii in range(data_.shape[1])][:16]
--> 178 vis.text('</br>'.join([''.join(poetry) for poetry in poetrys]), win=u'origin_poem')
179
18it [00:20,ipdb> poetr = [[ix2word[_word] for _word in data_[:, _iii].tolist()] for _iii in range(data_.shape[1])][:16]
*** NameError: name 'data_' is not defined
在第九章的main.py的可视化操作中
在运行一次的时候是可以的,但是
我试图在ipdb中重新运行这一句代码,就会出现提示data没有定义的情况,现在基本可以确定,是指data[:, _iii].tolist()的data_没有定义,这个就很诡异了。 想问一下大家,这个是因为什么,在命令行界面反而不能行。在文件里却可以。 希望得到大家的解答