Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
How to pad MNIST dataset images of size (?,28,28,1) with tf.pad() and make it (?,32,32,1) in tensorflow?
(?,28,28,1)
tf.pad()
(?,32,32,1)
这取决于您打算如何填充它。上的例子是这样的:
# Assuming input is a tensor with shape (?, 28, 28, 1) output = tf.pad(input, [[0, 0], [2,2], [2,2], [0,0]]) # print(tf.shape(output)) should be (?, 32, 32, 1)