问题描述:在使用tensorflow时,RuntimeError: `loss` passed to Optimizer.compute_gradients should be a funct
原来代码:
train = tf.train.GradientDescentOptimizer(0.01).minimize(cost)
改正代码:
train = tf.compat.v1.train.GradientDescentOptimizer(0.01).minimize(cost)