我是新手,我真的需要你在python中使用張量流的幫助。使用張量流Practical_seq2seq的錯誤
我想通過使用這個link in github建立chatbot序列序列。但是當我開始運行這個代碼python 03-Twitter-chatbot.py
(下載後然後提取數據集和read the related article)程序沒有運行。並說明了這些錯誤消息:
<log> Building Graph Traceback (most recent call last):
File "03-Twitter-chatbot.py", line 33, in <module>
num_layers=3
File "D:\Temporary\abang nitip\Directory\practical_seq2seq-master\seq2seq_wrapper.py", line 79, in __init__ __graph__()
File "D:\Temporary\abang nitip\Directory\practical_seq2seq-master\seq2seq_wrapper.py", line 45, in __graph__ basic_cell = tf.contrib.rnn.core_rnn_cell.DropoutWrapper(AttributeError: module 'tensorflow.contrib.rnn' has no attribute 'core_rnn_cell'
我不知道發生什麼事,我開始運行另一個code錯誤是不同的這是說,我的tensorflow無法導入basic_rnn或seq2seq。然後我檢查了我tensorflow在CMD運行此代碼:
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))
打字sess = tf.Session()
後有這樣的消息:
2017-07-18 13:46:37.730648: W C:\tf_jenkins\home\workspace\nightly-win\M\windows\PY\35\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
2017-07-18 13:46:37.731648: W C:\tf_jenkins\home\workspace\nightly-win\M\windows\PY\35\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations.
我不知道如何解決這個問題,我只是猜測也許我的tensorflow運行不好。我在我的電腦中使用tensorflow和特定版本Windows 7 Ultimate - 64位,Python 3.5.2。
請幫我解決這個問題。 而且我很抱歉我的英文不好
我幾天前有過這個問題。您的tensorflow版本可能是1.0 並且代碼是針對早期版本編寫的。這裏的 https://github.com/pender/chatbot-rnn/issues/6是問題和更新代碼的github鏈接。 –
謝謝@venky__我只是嘗試在該鏈接上替換model.py中的代碼,但仍然無法運行,因爲tensorflow無法識別'core_rnn_cell' –