原文: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