The value of a feed cannot be a tf.Tensor object.

使用tf.data.Dataset时出现报错“The value of a feed cannot be a tf.Tensor object.”

session.run(train_op, feed_dict={model.image_4d:x,model.y:y})

如上面的代码,tf.data.Dataset生成的是x和y是tensor,所以现将x和y转为numpy格式

x, y = session.run([x,y])
session.run(train_op, feed_dict={model.image_4d:x,model.y:y})

 

你可能感兴趣的:(TensorFlow)