为什么我会收到此错误slim.fully_connected()
?
ValueError: Input 0 of layer fc1 is incompatible with the layer: : expected min_ndim=2, found ndim=1. Full shape received: [32]
我的输入Tensor("batch:0", shape=(32,), dtype=float32)
来自tf.train.batch()
inputs, labels = tf.train.batch(
[input, label],
batch_size=batch_size,
num_threads=1,
capacity=2 * batch_size)
如果我重塑输入(32,1)
它的工作正常。
inputs, targets = load_batch(train_dataset)
print("inputs:", inputs, "targets:", targets)
# inputs: Tensor("batch:0", shape=(32,), dtype=float32) targets: Tensor("batch:1", shape=(32,), dtype=float32)
inputs = tf.reshape(inputs, [-1,1])
targets = tf.reshape(targets, [-1,1])
苗条演练中的示例似乎在没有明确重塑之后就可以工作load_batch()