Skip to content

Commit b1b47a1

Browse files
Address deprecation warnings.
1 parent 2f0c1ba commit b1b47a1

23 files changed

+27
-27
lines changed

examples/2_BasicModels/linear_regression.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
optimizer = tf.train.GradientDescentOptimizer(learning_rate).minimize(cost)
4242

4343
# Initializing the variables
44-
init = tf.initialize_all_variables()
44+
init = tf.global_variables_initializer()
4545

4646
# Launch the graph
4747
with tf.Session() as sess:

examples/2_BasicModels/logistic_regression.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
optimizer = tf.train.GradientDescentOptimizer(learning_rate).minimize(cost)
3939

4040
# Initializing the variables
41-
init = tf.initialize_all_variables()
41+
init = tf.global_variables_initializer()
4242

4343
# Launch the graph
4444
with tf.Session() as sess:

examples/2_BasicModels/nearest_neighbor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
accuracy = 0.
3434

3535
# Initializing the variables
36-
init = tf.initialize_all_variables()
36+
init = tf.global_variables_initializer()
3737

3838
# Launch the graph
3939
with tf.Session() as sess:

examples/3_NeuralNetworks/autoencoder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def decoder(x):
8383
optimizer = tf.train.RMSPropOptimizer(learning_rate).minimize(cost)
8484

8585
# Initializing the variables
86-
init = tf.initialize_all_variables()
86+
init = tf.global_variables_initializer()
8787

8888
# Launch the graph
8989
with tf.Session() as sess:

examples/3_NeuralNetworks/bidirectional_rnn.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def BiRNN(x, weights, biases):
9090
accuracy = tf.reduce_mean(tf.cast(correct_pred, tf.float32))
9191

9292
# Initializing the variables
93-
init = tf.initialize_all_variables()
93+
init = tf.global_variables_initializer()
9494

9595
# Launch the graph
9696
with tf.Session() as sess:

examples/3_NeuralNetworks/convolutional_network.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def conv_net(x, weights, biases, dropout):
104104
accuracy = tf.reduce_mean(tf.cast(correct_pred, tf.float32))
105105

106106
# Initializing the variables
107-
init = tf.initialize_all_variables()
107+
init = tf.global_variables_initializer()
108108

109109
# Launch the graph
110110
with tf.Session() as sess:

examples/3_NeuralNetworks/dynamic_rnn.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def dynamicRNN(x, seqlen, weights, biases):
162162
accuracy = tf.reduce_mean(tf.cast(correct_pred, tf.float32))
163163

164164
# Initializing the variables
165-
init = tf.initialize_all_variables()
165+
init = tf.global_variables_initializer()
166166

167167
# Launch the graph
168168
with tf.Session() as sess:

examples/3_NeuralNetworks/multilayer_perceptron.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def multilayer_perceptron(x, weights, biases):
6464
optimizer = tf.train.AdamOptimizer(learning_rate=learning_rate).minimize(cost)
6565

6666
# Initializing the variables
67-
init = tf.initialize_all_variables()
67+
init = tf.global_variables_initializer()
6868

6969
# Launch the graph
7070
with tf.Session() as sess:

examples/3_NeuralNetworks/recurrent_network.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def RNN(x, weights, biases):
8080
accuracy = tf.reduce_mean(tf.cast(correct_pred, tf.float32))
8181

8282
# Initializing the variables
83-
init = tf.initialize_all_variables()
83+
init = tf.global_variables_initializer()
8484

8585
# Launch the graph
8686
with tf.Session() as sess:

examples/4_Utils/save_restore_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def multilayer_perceptron(x, weights, biases):
6464
optimizer = tf.train.AdamOptimizer(learning_rate=learning_rate).minimize(cost)
6565

6666
# Initializing the variables
67-
init = tf.initialize_all_variables()
67+
init = tf.global_variables_initializer()
6868

6969
# 'Saver' op to save and restore all the variables
7070
saver = tf.train.Saver()

examples/4_Utils/tensorboard_advanced.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def multilayer_perceptron(x, weights, biases):
8888
acc = tf.reduce_mean(tf.cast(acc, tf.float32))
8989

9090
# Initializing the variables
91-
init = tf.initialize_all_variables()
91+
init = tf.global_variables_initializer()
9292

9393
# Create a summary to monitor cost tensor
9494
tf.scalar_summary("loss", loss)

examples/4_Utils/tensorboard_basic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
acc = tf.reduce_mean(tf.cast(acc, tf.float32))
5050

5151
# Initializing the variables
52-
init = tf.initialize_all_variables()
52+
init = tf.global_variables_initializer()
5353

5454
# Create a summary to monitor cost tensor
5555
tf.scalar_summary("loss", cost)

notebooks/2_BasicModels/linear_regression.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
"outputs": [],
111111
"source": [
112112
"# Initializing the variables\n",
113-
"init = tf.initialize_all_variables()"
113+
"init = tf.global_variables_initializer()"
114114
]
115115
},
116116
{

notebooks/2_BasicModels/logistic_regression.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
"optimizer = tf.train.GradientDescentOptimizer(learning_rate).minimize(cost)\n",
7474
"\n",
7575
"# Initializing the variables\n",
76-
"init = tf.initialize_all_variables()"
76+
"init = tf.global_variables_initializer()"
7777
]
7878
},
7979
{
@@ -169,4 +169,4 @@
169169
},
170170
"nbformat": 4,
171171
"nbformat_minor": 0
172-
}
172+
}

notebooks/2_BasicModels/nearest_neighbor.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
"accuracy = 0.\n",
6969
"\n",
7070
"# Initializing the variables\n",
71-
"init = tf.initialize_all_variables()"
71+
"init = tf.global_variables_initializer()"
7272
]
7373
},
7474
{
@@ -328,4 +328,4 @@
328328
},
329329
"nbformat": 4,
330330
"nbformat_minor": 0
331-
}
331+
}

notebooks/3_NeuralNetworks/autoencoder.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@
129129
"optimizer = tf.train.RMSPropOptimizer(learning_rate).minimize(cost)\n",
130130
"\n",
131131
"# Initializing the variables\n",
132-
"init = tf.initialize_all_variables()"
132+
"init = tf.global_variables_initializer()"
133133
]
134134
},
135135
{

notebooks/3_NeuralNetworks/bidirectional_rnn.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@
134134
"accuracy = tf.reduce_mean(tf.cast(correct_pred, tf.float32))\n",
135135
"\n",
136136
"# Initializing the variables\n",
137-
"init = tf.initialize_all_variables()"
137+
"init = tf.global_variables_initializer()"
138138
]
139139
},
140140
{

notebooks/3_NeuralNetworks/convolutional_network.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@
158158
"accuracy = tf.reduce_mean(tf.cast(correct_pred, tf.float32))\n",
159159
"\n",
160160
"# Initializing the variables\n",
161-
"init = tf.initialize_all_variables()"
161+
"init = tf.global_variables_initializer()"
162162
]
163163
},
164164
{

notebooks/3_NeuralNetworks/multilayer_perceptron.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118
"optimizer = tf.train.AdamOptimizer(learning_rate=learning_rate).minimize(cost)\n",
119119
"\n",
120120
"# Initializing the variables\n",
121-
"init = tf.initialize_all_variables()"
121+
"init = tf.global_variables_initializer()"
122122
]
123123
},
124124
{
@@ -204,4 +204,4 @@
204204
},
205205
"nbformat": 4,
206206
"nbformat_minor": 0
207-
}
207+
}

notebooks/3_NeuralNetworks/recurrent_network.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@
125125
"accuracy = tf.reduce_mean(tf.cast(correct_pred, tf.float32))\n",
126126
"\n",
127127
"# Initializing the variables\n",
128-
"init = tf.initialize_all_variables()"
128+
"init = tf.global_variables_initializer()"
129129
]
130130
},
131131
{

notebooks/4_Utils/save_restore_model.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
"optimizer = tf.train.AdamOptimizer(learning_rate=learning_rate).minimize(cost)\n",
102102
"\n",
103103
"# Initializing the variables\n",
104-
"init = tf.initialize_all_variables()"
104+
"init = tf.global_variables_initializer()"
105105
]
106106
},
107107
{
@@ -268,4 +268,4 @@
268268
},
269269
"nbformat": 4,
270270
"nbformat_minor": 0
271-
}
271+
}

notebooks/4_Utils/tensorboard_basic.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
" acc = tf.reduce_mean(tf.cast(acc, tf.float32))\n",
9696
"\n",
9797
"# Initializing the variables\n",
98-
"init = tf.initialize_all_variables()\n",
98+
"init = tf.global_variables_initializer()\n",
9999
"\n",
100100
"# Create a summary to monitor cost tensor\n",
101101
"tf.scalar_summary(\"loss\", cost)\n",

notebooks/5_MultiGPU/multigpu_basics.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,4 +175,4 @@
175175
},
176176
"nbformat": 4,
177177
"nbformat_minor": 0
178-
}
178+
}

0 commit comments

Comments
 (0)