Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def partitioner(shape, **unused_args):
)

# Shape [sentence_length, batch_size]
outputs_concat = tf.squeeze(tf.pack(outputs))
outputs_concat = tf.squeeze(tf.stack(outputs))

# Shape [batch_size]
predictions = tf.reduce_mean(
Expand Down
2 changes: 1 addition & 1 deletion workshop_sections/mnist_series/mnist_cnn/mnist_cnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def max_pool_2x2(x):
loss_summary = tf.scalar_summary("loss", cross_entropy)
train_summary_op = tf.merge_summary([loss_summary])

sess.run(tf.initialize_all_variables())
sess.run(tf.global_variables_initializer())

# Create a saver for writing training checkpoints.
saver = tf.train.Saver()
Expand Down
2 changes: 1 addition & 1 deletion workshop_sections/mnist_series/mnist_simple.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
"outputs": [],
"source": [
"NUM_STEPS = 10000\n",
"init = tf.initialize_all_variables()\n",
"init = tf.global_variables_initializer()\n",
"sess = tf.Session()\n",
"sess.run(init)"
]
Expand Down
2 changes: 1 addition & 1 deletion workshop_sections/mnist_series/mnist_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def main(_):
train_step = tf.train.GradientDescentOptimizer(0.5).minimize(cross_entropy)

sess = tf.InteractiveSession()
tf.initialize_all_variables().run()
tf.global_variables_initializer().run()
# Train
print("training for %s steps" % FLAGS.num_steps)
for _ in xrange(FLAGS.num_steps):
Expand Down
2 changes: 1 addition & 1 deletion workshop_sections/mnist_series/mnist_tflearn.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@
},
"outputs": [],
"source": [
"print(\"Running DNN classifier with .1 learning rate...\")\n",
"print(\"Running DNN classifier with .5 learning rate...\")\n",
"classifier = define_and_run_dnn_classifier(5000, getNewPath(), lr=.5)"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def main(_):
train_summary_op = tf.merge_summary([loss_summary, acc_summary])

# Add the variable initializer Op.
init = tf.initialize_all_variables()
init = tf.global_variables_initializer()

# Create a saver for writing training checkpoints.
saver = tf.train.Saver()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@
" train_summary_op = tf.merge_summary([loss_summary])\n",
"\n",
" # Add the variable initializer Op.\n",
" init = tf.initialize_all_variables()\n",
" init = tf.global_variables_initializer()\n",
"\n",
" # Create a saver for writing training checkpoints.\n",
" saver = tf.train.Saver()\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def main(_):
train_summary_op = tf.merge_summary([loss_summary])

# Add the variable initializer Op.
init = tf.initialize_all_variables()
init = tf.global_variables_initializer()

# Create a saver for writing training checkpoints.
saver = tf.train.Saver()
Expand Down
2 changes: 1 addition & 1 deletion workshop_sections/starter_tf_graph/tf_matrix_mul.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"m3 = tf.Print(m3, [m3], message=\"m3 is: \")\n",
"\n",
"# Add variable initializer.\n",
"init = tf.initialize_all_variables()\n"
"init = tf.global_variables_initializer()\n"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion workshop_sections/starter_tf_graph/tf_matrix_mul.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
m3 = tf.Print(m3, [m3], message="m3 is: ")

# Add variable initializer.
init = tf.initialize_all_variables() # global_variables_initializer() in TF0.12
init = tf.global_variables_initializer() # global_variables_initializer() in TF0.12

with tf.Session() as session:
# We must initialize all variables before we use them.
Expand Down
2 changes: 1 addition & 1 deletion workshop_sections/starter_tf_graph/tf_matrix_mul_add.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
# m4 = m3 + m3

# Add variable initializer.
init = tf.initialize_all_variables()
init = tf.global_variables_initializer()

with tf.Session() as session:
# We must initialize all variables before we use them.
Expand Down
4 changes: 2 additions & 2 deletions workshop_sections/transfer_learning/cloudml/trainer/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,8 @@ def decode_and_resize(image_str_tensor):
image = tf.image.convert_image_dtype(image, dtype=tf.float32)

# Then shift images to [-1, 1) for Inception.
image = tf.sub(image, 0.5)
image = tf.mul(image, 2.0)
image = tf.subtract(image, 0.5)
image = tf.multiply(image, 2.0)

# Build Inception layers, which expect A tensor of type float from [-1, 1)
# and shape [batch_size, height, width, channels].
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def __init__(self, tf_session):
# input_jpeg is the tensor that contains raw image bytes.
# It is used to feed image bytes and obtain embeddings.
self.input_jpeg, self.embedding = self.build_graph()
self.tf_session.run(tf.initialize_all_variables())
self.tf_session.run(tf.global_variables_initializer())
self.restore_from_checkpoint(Default.IMAGE_GRAPH_CHECKPOINT_URI)

def build_graph(self):
Expand Down Expand Up @@ -212,8 +212,8 @@ def build_graph(self):
image, [self.HEIGHT, self.WIDTH], align_corners=False)

# Then rescale range to [-1, 1) for Inception.
image = tf.sub(image, 0.5)
inception_input = tf.mul(image, 2.0)
image = tf.subtract(image, 0.5)
inception_input = tf.multiply(image, 2.0)

# Build Inception layers, which expect a tensor of type float from [-1, 1)
# and shape [batch_size, height, width, channels].
Expand Down