我在jupyter笔记本中运行程序并且终端正常,但用pycharm打开它是不正常的! 相同的tensorflow版本和python版本,相同的.py文件 我很困惑 可能是关键代码:
def generate_batch(feats, labels, batch_size, shuffle, min_queue_examples):
num_preprocess_threads = 2
if shuffle:
feat_batch, label_batch = tf.train.shuffle_batch(
[feats, labels],
batch_size=batch_size,
#num_threads=num_preprocess_threads,
capacity=min_queue_examples + 3*batch_size,
min_after_dequeue=min_queue_examples,
allow_smaller_final_batch=True)
else:
feat_batch, label_batch = tf.train.batch(
[feats, labels],
batch_size=batch_size,
#num_threads=num_preprocess_threads,
allow_smaller_final_batch=True,
capacity=min_queue_examples + 3*batch_size)
print(label_batch)
print(feat_batch)
return feat_batch, tf.reshape(label_batch,[-1])
OutOfRangeError(参见上面的回溯):FIFOQueue' _1_batch / fifo_queue'关闭且元素不足(请求50,当前大小0) [[Node:batch = QueueDequeueUpToV2 [component_types = [DT_FLOAT,DT_INT64],timeout_ms = -1,_device =" / job:localhost / replica:0 / task:0 / device:CPU:0"]( batch / fifo_queue,batch / n)]]