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