【发布时间】:2021-01-14 13:42:35
【问题描述】:
我在训练一个多元线性回归模型,出现了这个错误码。
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])
【问题讨论】: