Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/tensorflow/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用Tensorflow for Google Streetview数据集进行图像识别时遇到的问题_Tensorflow_Data Pipeline - Fatal编程技术网

使用Tensorflow for Google Streetview数据集进行图像识别时遇到的问题

使用Tensorflow for Google Streetview数据集进行图像识别时遇到的问题,tensorflow,data-pipeline,Tensorflow,Data Pipeline,我正在运行这个代码来对谷歌街景中的门牌号进行分类,它会运行,然后在第一步进入某种循环,我不知道为什么 我已经将问题缩小到输入管道的范围 def convert_labels(labels): for i in range(len(labels)): if len(labels[i])==2: labels[i].append(10) elif len(labels[i])==1: labels[i].appe

我正在运行这个代码来对谷歌街景中的门牌号进行分类,它会运行,然后在第一步进入某种循环,我不知道为什么

我已经将问题缩小到输入管道的范围

def convert_labels(labels):
    for i in range(len(labels)):
        if len(labels[i])==2:
            labels[i].append(10)
        elif len(labels[i])==1:
            labels[i].append(10)
            labels[i].append(10)
    return labels

with open('whole_data.pickle','rb') as f:
    data_obj=pickle.load(f)
train_images=np.asarray(data_obj['train_data'][0],np.float32)
train_labels=np.asarray(convert_labels(data_obj['train_data'][1]),np.int32)
whole_train=[train_images,train_labels]
whole_train[0]=np.reshape(whole_train[0][:],[whole_train[0].shape[0],32,32,1])

graph = tf.Graph()

with graph.as_default():
    with tf.name_scope('Pipelines'):
        image_batch,label_batch=tf.train.shuffle_batch([whole_train[0],
        batch_size=64,capacity=50000,enqueue_many=True,min_after_dequeue=100,
        name='train_pipe')


with tf.Session(graph=graph) as sess:
tf.global_variables_initializer().run()
writer=tf.summary.FileWriter('/tmp/Mark2_logs',graph=graph)
step=1 
print('hi')
for step in range(100): 
    print('step %d' %(step))
    batch_images,batch_labels=sess.run([image_batch,label_batch])
    plt.imshow(batch_images[0])
我已将一个链接连接到我存储数据和代码的谷歌硬盘:

它包含三个文件

  • model.ipynb-它是包含CNN和会话的主文件
  • ipynb-这是我用来处理数据和数据的代码
  • data.pickle-我已经在这个文件中处理并存储了我的数据,所以您不必运行preprocess.ipynb

非现场演示的问题不在本主题中。你能说明问题本身的问题吗?我无法正确格式化我的代码的大块,StackOverflow不接受它。我该怎么办?我添加了我的tensorboard图,它是在第一次迭代中生成的,如果有帮助的话,“StackOverflow不接受它”是什么意思?如果代码块太大,那么是的,您需要将其缩减为一个较小的示例。嘿,@halfer我将问题缩小到我的输入管道,因为我单独运行了它,它显示了相同的问题,它只是卡住了并保持不变。