Skip to content

Commit e5eaa20

Browse files
authored
Merge pull request #55 from codercuixin/master
添加 tf.local_variables_initializer()
2 parents fea49c4 + 502da0a commit e5eaa20

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Deep_Learning_with_TensorFlow/1.0.0/Chapter07/5. 输入文件队列.ipynb

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
" 'j': tf.FixedLenFeature([], tf.int64),\n",
8585
" })\n",
8686
"with tf.Session() as sess:\n",
87-
" tf.global_variables_initializer().run()\n",
87+
" sess.run([tf.global_variables_initializer(), tf.local_variables_initializer()])\n",
8888
" print sess.run(files)\n",
8989
" coord = tf.train.Coordinator()\n",
9090
" threads = tf.train.start_queue_runners(sess=sess, coord=coord)\n",
@@ -122,11 +122,11 @@
122122
"example, label = features['i'], features['j']\n",
123123
"batch_size = 2\n",
124124
"capacity = 1000 + 3 * batch_size\n",
125-
"capacity = 1000 + 3 * batch_size\n",
126125
"example_batch, label_batch = tf.train.batch([example, label], batch_size=batch_size, capacity=capacity)\n",
127126
"\n",
128127
"with tf.Session() as sess:\n",
129128
" tf.global_variables_initializer().run()\n",
129+
" tf.local_variables_initializer().run()\n",
130130
" coord = tf.train.Coordinator()\n",
131131
" threads = tf.train.start_queue_runners(sess=sess, coord=coord)\n",
132132
" for i in range(3):\n",

0 commit comments

Comments
 (0)