gpt4 book ai didi

tensorflow - 属性错误 : module 'tensorflow' has no attribute 'unpack'

转载 作者:行者123 更新时间:2023-12-01 23:07:39 24 4
gpt4 key购买 nike

我正在尝试使用 tfLearn 运行 lstm 模型,但出现此错误:

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

最佳答案

在 tf 1.0 中,没有unpack。您可能想改用 unstack。升级之前的代码,可以引用https://www.tensorflow.org/install/migration .但是我不知道是否有更新整个深度学习库的工具,例如 tflearn = =

关于tensorflow - 属性错误 : module 'tensorflow' has no attribute 'unpack' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42315234/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com