WARNING:tensorflow:From4: The name tf.Session is deprecated. Please use tf.compat.v1.Session instead

First, the environment:
tensorflow 1.14
Second, the error description:

WARNING:tensorflow:From /Users/suyongxing/gogodate/pythonProject/TensorLearn/lesson_one/test33.py:4: The name tf.Session is deprecated. Please use tf.compat.v1.Session instead.

Third, the error analysis:
In order to make TensorFlow more simplicity in version 2.0, no tf.Session on TF 2.0 design.
TensorFlow 1.X requires the user by calling tf. * API Manual abstract syntax tree (graphic) spliced together. Then, it requires the user to pass through a set of input and output tensor tensor to session.run () is called to compile manually abstract syntax tree.
TensorFlow 2.0 eagerly execution (like Python usual), in 2.0, graphics, and the session should feel like implementation details.
Fourth, the solutions (usually not necessary):

import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()

or

tf.compat.v1.Session

Instead tf.session

Published 45 original articles · won praise 28 · views 10000 +

Guess you like

Origin blog.csdn.net/m0_43505377/article/details/103916299