[tensorflow]TypeError: Fetch argument .+ has invalid type
来源:互联网 发布:unity3d游戏开发pdf 编辑:程序博客网 时间:2024/06/04 19:00
TypeError: Fetch argument ~ has invalid type, must be a string or Tensor. (Can not convert a float32 into a Tensor or Operation.)
今天,调试tensorflow的时候,出现了以上错误。 看了半天代码没有都发现真正的错误。
其出错的状况特别奇怪:迭代的第一步运行十分流畅,但是第二步就开始报错。错误信息,见上。
google了一下才恍然大悟。
https://stackoverflow.com/questions/38306330/tensorflow-typeerror-on-session-run-arguments-output/
stackoverflow也有人有类似经历。。。
_, l, train_predictions = session.run([optimizer, loss, train_predictions], feed_dict=feed_dict)
不知道各位看出错误来没有。tensorflow的命名空间很重要。
第一次正确运行后
train_predictions 已经有值了,假设其为,0.25.
那么下次迭代,代入train_predictions就会报错了。
因为,出现了以下的代码调用:
_, l, trained_predictions = session.run([optimizer, loss, 0.25], feed_dict=feed_dict)
显然,tensorflow不能理解这一调用方式。自然报出type error的错误。
1 0
- [tensorflow]TypeError: Fetch argument .+ has invalid type
- TypeError: Fetch argument None has invalid type <class 'NoneType'>解决方案
- TypeError: Input 'b' of 'MatMul' Op has type float32 that does not match type int32 of argument 'a'.
- tensorflow TypeError: run() got multiple values for argument 'feed_dict'
- TypeError: argument of type 'int' is not iterable
- TypeError: exchange_declare() got an unexpected keyword argument 'type'的解决办法
- SSLSessionCache: Invalid argument: size has to be >= 8192 bytes
- invalid argument
- TypeError: object of type 'NoneType' has no len()
- TypeError: object of type 'zip' has no len()
- python 2.7版本解决TypeError: 'encoding' is an invalid keyword argument for this function
- jni编译时出现:warning: format '%d' expects argument of type 'int', but argument 4 has
- #Tensorflow# TypeError: set_shape() takes 1 positional argument but 2 were given
- super() fails with error: TypeError “argument 1 must be type, not classobj”
- [C/C++]warning: format '%c' expects argument of type 'char*', but argument 2 has type 'int' [-Wforma
- inet_ntoa编译提示警告: 格式 ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘int’ [-Wformat]
- g++编译报错原因分析 format ?.d?.expects argument of type ?.nt?. but argument 3 has type ?.
- linux c之提示format‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long int’ [-Wformat
- JSP--tomacat安装测试(windows10)
- Android开发笔记(一百三十七)自定义行为Behavior
- POJ 2240 Arbitrage 最短路线
- 记录自己使用瓦片图的坑
- JavaEE框架整合视频
- [tensorflow]TypeError: Fetch argument .+ has invalid type
- GPU 共享内存bank冲突(shared memory bank conflicts)
- 1125. Chain the Ropes 解析
- Android中自定义属性attrs.xml、TypedArray的使用
- 关于addShutdownHook()
- 父类委托机制[2]父类委托机制真的安全吗
- PCA SVD LDA --- Machine Learning笔记1
- Tomcat多应用共享Session
- 二叉树