state = cell.zero_state(batchsize, tf.float32).eval()
我想按照这个https://github.com/kvfrans/twitch/blob/master/sample.py#L45例如解码和运行一个训练有素的tensorflow模型,但它似乎是使用了旧版本的tensorflow代码。我已成功地修复大多数呼叫到v 1.0.0,但我被困在那里上面的代码行给了我以下错误:Tensorflow:AttributeError的:“元组”对象有没有属性“的eval”
Traceback (most recent call last):
File "server.py", line 1, in <module>
from sample import *
File "/home/user/twitch/sample.py", line 75, in <module>
print predict("this game is")
File "/home/user/twitch/sample.py", line 46, in predict
state = initialstate.eval()
AttributeError: 'tuple' object has no attribute 'eval'
,我应该如何解决.eval()
和state
任何想法?它在以后使用:
guessed_logits, state = sess.run([logits, final_state], feed_dict={input_data: primer, initialstate: state})
这工作,非常感谢你! – Blizzard