TypeError: Fetch argument 12434120.0 has invalid type <class 'numpy.float32'>, must be a string or Tensor. (in Tensorflow)
TypeError: Fetch argument 12434120.0 has invalid type <class 'numpy.float32'>, must be a string or Tensor. (in Tensorflow)
我正在训练一个多元线性回归模型,出现了这个错误代码。
TypeError: Fetch argument 12434120.0 has invalid type <class 'numpy.float32'>, must be a string or Tensor. (Can not convert a float32 into a Tensor or Operation.)
我想知道这是什么意思...
训练代码是这样的:
for step in range(100001):
cost_, hypo_, _ = sess.run([cost, hypothesis, train], feed_dict={X: x_data,Y: y_data})
if step % 500 == 0:
print('#', step, 'loss:', cost_))
print('-price of cabbage:', hypo_[0])
我重新启动了内核,突然就可以了...我认为问题是名称重复'cost',所以我将其更改为'cost_'
我正在训练一个多元线性回归模型,出现了这个错误代码。
TypeError: Fetch argument 12434120.0 has invalid type <class 'numpy.float32'>, must be a string or Tensor. (Can not convert a float32 into a Tensor or Operation.)
我想知道这是什么意思... 训练代码是这样的:
for step in range(100001):
cost_, hypo_, _ = sess.run([cost, hypothesis, train], feed_dict={X: x_data,Y: y_data})
if step % 500 == 0:
print('#', step, 'loss:', cost_))
print('-price of cabbage:', hypo_[0])
我重新启动了内核,突然就可以了...我认为问题是名称重复'cost',所以我将其更改为'cost_'