Why do I get this error for 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]
my input is Tensor("batch:0", shape=(32,), dtype=float32)
from tf.train.batch()
inputs, labels = tf.train.batch(
[input, label],
batch_size=batch_size,
num_threads=1,
capacity=2 * batch_size)
if I reshape the input to (32,1)
it works fine.
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])
The examples in slim walkthrough seem to work without explicitly reshaping after load_batch()