原文:Django整合Keras報錯:ValueError: Tensor Tensor("Placeholder:0", shape=(3, 3, 1, 32), dtype=float32) is not an element of this graph.解決方法

本人在寫Django RESful API時,碰到一個難題,老出現,整合Keras,報如下錯誤 很糾結,探索找資料近一個星期,皇天不負有心人,解決了 個人理解:在初始化Django時,把keras中 model先初始化,免得后面不斷調用,產生莫名其妙的問題 Django初始化代碼寫在 init .py中: 很有用的參考,非常感謝 參考:https: zhuanlan.zhihu.com p ...

2018-01-08 14:39 6 12197 推薦指數:

查看詳情

tensorflow TypeError: Can not convert a float32 into a Tensor or Operation

遇到這種情況可能是你的程序中有和你定義的tensor 變量重名的其他變量名字,jishi在for循環中使用了這個名字的作為臨時變量也不行.tenor 變量很嬌氣.坑了我一晚上的時間. 比如:x = tf.placeholder(tf.float32,[None,512]) 那么在程序中就 ...

Thu May 09 04:52:00 CST 2019 0 556
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM