0
Iは、次の変数に
mnist
画像値のアレイを割り当てる必要
...numpyアレイを特定の形状に連結するにはどうすればいいですか?
x = tf.get_variable("input_image", shape=[10,784], dtype=tf.float32)
問題は、Iセットmnist
データを取捨選択し、番号2の10枚の画像を抽出し、それを割り当てる必要がありますx
。
これは、問題は、私は私のロジックは欠陥があると信じている
while mnist.test.next_batch(FLAGS.batch_size):
sample_image, sample_label = mnist.test.next_batch(10)
# get number 2
itemindex = np.where(sample_label == 1)
if itemindex[1][0] == 1:
# append image to numpy
np.append(labels_of_2, sample_image)
# if the numpy array has 10 images then we stop
if labels_of_2.size == 10:
break
# assign to variable
sess.run(tf.assign(x, labels_of_2))
...データセットをふるい及び数2の抽出での私のアプローチです。私は私が望むものを達成するための簡単な方法が存在しなければならない
np.append(labels_of_2, sample_image)
...変数x
を満たし、明確に次の行がそれを行うための方法ではありませんする形状[10, 784]
の配列を必要とするが、私はそれを把握することはできませんでる。