2017-02-18 46 views
1

我試圖用tfLearn運行lstm模型,我得到這個錯誤:AttributeError的:模塊 'tensorflow' 有沒有屬性 '解包'

File "...city_names.py", line 16, in <module> 
g = tflearn.lstm(g, 256, activation='relu', return_seq=True) 
File "...\tflearn\layers\recurrent.py", line 197, in lstm 
inference = tf.unpack(inference) 
AttributeError: module 'tensorflow' has no attribute 'unpack' 

與以下行:

g = tflearn.input_data(shape=[None, maxlen, len(char_idx)]) 

這些是代碼行:

path = "US_cities.txt" 
maxlen = 20 
X, Y, char_idx = textfile_to_semi_redundant_sequences(path, seq_maxlen=maxlen, redun_step=3) 
g = tflearn.input_data(shape=[None, maxlen, len(char_idx)]) 
g = tflearn.input_data(shape=[None, maxlen, len(char_idx)]) 
+0

在tf 1.0中,沒有'unpack'。您可能想使用'unstack'來代替。 – soloice

+0

所以文件recurrent.py沒有被更新。你知道我可以在哪裏得到更新的代碼嗎? – suku

+0

https://www.tensorflow.org/install/migration – soloice

回答

0

我有同樣的問題,並安裝TFLearn的最新版本('出血端'),我沒有得到與TensorFlow 1.0一起使用'unpack'屬性錯誤。

我在終端中使用下面的命令來安裝TFLearn 0.3

pip install git+https://github.com/tflearn/tflearn.git 

這是根據在TFLearn GitHub page指令。

相關問題