typeError:The value of a feed cannot be a tf.Tensor object.Acceptable feed values include Python scalars,strings,lists.numpy ndarrays,or TensorHandles.For reference.the tensor object was Tensor...,,如上贴出了:错误信息
typeError:The value of a feed cannot be a tf.Tensor object.Acceptable feed values include Python scalars,strings,lists.numpy ndarrays,or TensorHandles.For reference.the tensor object was Tensor...,,如上贴出了:错误信息
如上贴出了:错误信息和错误代码。
这个问题困扰了自己两天,报错大概是说输入的数据和接受的格式不一样,不能作为tensor。
后来问了大神,原因出在tf.reshape(),因为网络训练时用placeholder定义了输入格式,所以输入不能用tensor,而tf.reshape()返回结果就是一个tensor了,所以输入会报错。
因此改为了这种格式
灵机一动,全都使用numpy里面的方法提供格式的转换,这样就不会产生tensor形的变量了。改完以后成功运行
typeError:The value of a feed cannot be a tf.Tensor object.Acceptable feed values include Python scalars,strings,lists.numpy ndarrays,or TensorHandles.For reference.the tensor object was Tensor...
相关内容
- 安装homeassistant+python3.6,,python3.6×
- linux添加PYTHONPATH环境变量,,1、添加环境变量到p
- 吴裕雄 python 神经网络——TensorFlow 图像预处理完整样例
- Python--格式化cookie为字典类型,,import req
- python学习 -- operator.itemgetter(), list.sort/sorted 以及lambda函
- python3中SSLError错误处理,,在deepin中安装
- python爬取主播信息,,之前学过python
- Python+Weditor,,1)下载、安装pyt
- python-----05(多进程),,1. Mult
- python 2.6涓?No module named sysconfig,,鏍囩锛?a hre
评论关闭