suku
suku

Reputation: 10929

AttributeError: module 'tensorflow' has no attribute 'unpack'

I am trying to run a lstm model using tfLearn and I get this error:

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'

with the following line:

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

These are the lines of code:

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)])

Upvotes: 2

Views: 5081

Answers (2)

Thomas Grusz
Thomas Grusz

Reputation: 93

I had the same problem and installed the latest ('bleeding edge') version of TFLearn and I did not get the 'unpack' attribute error anymore with TensorFlow 1.0 .

I used the following command in terminal to install TFLearn 0.3:

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

This is according to instructions on the TFLearn GitHub page.

Upvotes: 0

soloice
soloice

Reputation: 1040

In tf 1.0, there's no unpack. You may want to use unstack instead. To upgrade previous code, you can refer to https://www.tensorflow.org/install/migration. But I don't know if there's a tool for updating an entire deep learning library such like tflearn = =

Upvotes: 7

Related Questions