m new to tensorflow and python and I created a feed forward neural network with tensorflow that will help me to classify two groups of images. One group represents images of myself and another group represents images of a different person (I know convolutional network is better for this kind of problem but for the sake of learning I approached the FF network). All my images are stored in two separate directories. I
m 이미지를로드하여 NN에 공급하려고합니다. 내 이미지는 272x272 픽셀 RGB이므로 입력 레이어에는 73984 개의 뉴런이 있어야합니다. 이미지를로드하고 네트워크를 통해 이미지를로드 할 수 없습니다. 내가 실행할 때, 다음사용자 정의 이미지를 tensorflow로로드
filename_queue = tf.train.string_input_producer(tf.train.match_filenames_once("images/train/resized/*.jpg"))
reader = tf.WholeFileReader()
filename, content = reader.read(filename_queue)
image = tf.image.decode_jpeg(content, channels=3)
image = tf.cast(image, tf.float32)
resized_image = tf.image.resize_images(image, [272, 272])
과 :
sess.run([optimizer], feed_dict={x: resized_image, y: 1})
I 세대 오류
"피드의 값이 tf.Tensor 객체가 될 수 없다" 나는이 방법을 사용하여 시도더 나은 방법이 있습니까? 아니면 여기에서 누락 되었습니까? 감사합니다.
감사합니다. 그러나 코드를 실행할 때 정의 된 뉴런 수가 실제 입력 데이터와 일치하지 않기 때문에 네트워크 구조에서 첫 번째 레이어의 합계를 계산할 수 없습니다. 그러면 입력 뉴런의 수는 얼마입니까? –
입력 텐서를'x = tf.placeholder (tf.float32, (272, 272))'로 만들고 PIL을 사용하여 그레이 스케일'gray_image = Image.open ('image.png')의 이미지를 읽습니다. LA ')'그리고 나서 텐서'x'에'gray_image'를 입력하십시오. 여러분의 입력 뉴런은 텐서'x'의 형태에 따라 달라집니다. – Jai
감사합니다! –