1、TypeError: Cannot interpret feed_dict key as Tensor: Can not convert a float into a Tensor.
在feed_dict前有命名和喂进去的参数一样的变量
2、Python 错误 RuntimeError: CUDA error (10): invalid device ordinal
我是在终端运行的,有可能你设置的gups超出系统有的gup,可以通过nvidia-smi查看gup情况,如果不是这个原因,可以试试关闭程序,重新打开再试一次,我就是这么搞好的(😂)
3、 tensorflow.python.framework.errors_impl.InvalidArgumentError: You must feed a value for placeholder tensor ‘edge_train’ with dtype float and shape [?,512,512,1]
[[{{node edge_train}} = Placeholder[dtype=DT_FLOAT, shape=[?,512,512,1], _device="/job:localhost/replica:0/task:0/device:GPU:0"]()]]
[[{{node Neg/_55}} = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device_incarnation=1, tensor_name="edge_2608_Neg", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:CPU:0"]()]]
找到错误提示里的代码位置,把该变量添加进去(像这里就是把self.edge_train:XXX添加进去)。不管有没有用,加进去就完事了!
本文详细解析并提供了针对TensorFlow中常见的TypeError、RuntimeError及InvalidArgumentError等错误的解决方案,帮助开发者快速定位并修复问题。
&spm=1001.2101.3001.5002&articleId=104704925&d=1&t=3&u=337ed0a71d1d47e295ec11db484d5f90)
4884

被折叠的 条评论
为什么被折叠?



