tf2中的一些操作/函数替换汇总——从tensorflow1.x到tensorflow2.0

请看下面汇总:

The name tf.gfile.GFile is deprecated. Please use tf.io.gfile.GFile instead
The name tf.GraphDef is deprecated. Please use tf.compat.v1.GraphDef instead
The name tf.Session is deprecated. Please use tf.compat.v1.Session instead
The name tf.reset_default_graph is deprecated. Please use tf.compat.v1.reset_default_graph instead
The name tf.lite.experimental.nn.TfLiteRNNCell is deprecated. Please use tf.compat.v1.lite.experimental.nn.TfLiteRNNCell instead
The name tf.lite.experimental.nn.dynamic_rnn is deprecated. Please use tf.compat.v1.lite.experimental.nn.dynamic_rnn instead
dense (from tensorflow.python.layers.core) is deprecated and will be removed in a future version.
Instructions for updating:Use keras.layers.dense instead

string_input_producer (from tensorflow.python.training.input) is deprecated and will be removed in a future version.
Instructions for updating:
Queue-based input pipelines have been replaced by `tf.data`. Use `tf.data.Dataset.from_tensor_slices(string_tensor).shuffle(tf.shape(input_tensor, out_type=tf.int64)[0]).repeat(num_epochs)`. If `shuffle=False`, omit the `.shuffle(...)`.
The name tf.get_variable is deprecated. Please use tf.compat.v1.get_variable instead
The name tf.imag is deprecated. Please use tf.math.imag instead
 The name tf.log is deprecated. Please use tf.math.log instead

 The name tf.train.Saver is deprecated. Please use tf.compat.v1.train.Saver instead

The name tf.random_normal is deprecated. Please use tf.random.normal instead
The name tf.get_default_graph is deprecated. Please use tf.compat.v1.get_default_graph instead

CSDN有个缺点,光标如果没有到下一行插入代码,那么插入代码后你再也找不到下一行,Enter键也没用,始终都会在代码框这里。这个缺点很明显、突出。

 

另外有相关问题可以加入QQ群讨论,不设微信群

QQ群:868373192 

语音深度学习及信号处理群

你可能感兴趣的:(python)