我正在使用mnist数据来查看tf.train.shuffle_batch是如何工作的,我收到了这个错误

InvalidArgumentError(参见上述用于回溯):必须喂为占位符张量 'P' 的值与D型浮子[[节点:P = Placeholderdtype = DT_FLOAT,形状= [],_device =“/作业:本地主机/复制:0 /任务:0 / GPU:0 “]] [[节点:切片/ _1 = _Recvclient_terminated =假,recv_device =”/作业:本地主机/复制:0 /任务:0 / CPU:0" ,send_device =“/作业:本地主机/复制:0 /任务:0 / GPU:0" ,send_device_incarnation = 1,tensor_name = “edge_7_Slice”,tensor_type = DT_FLOAT,_device = “/作业:本地主机/复制:0 /任务:0 / CPU:0”]]

但我确实用dtype float给'p'占位符提供了一个值,所以我不知道为什么我得到这个错误

这是我的代码:

mnist = input_data.read_data_sets('../../MNIST_data', one_hot=True)
img = mnist.train.images
print(type(img))
print(img.shape)
p = tf.placeholder(tf.float32, [None, 784], name='p')
img_batch = tf.train.shuffle_batch([tf.slice(p, [np.random.randint(55000), 0], [1, -1])], 9, 130, 100)
with tf.Session() as sess:
    threads = tf.train.start_queue_runners(sess=sess)
    img_b = sess.run(img_batch, feed_dict={p: mnist.train.images})