From 17580e6c1bf9c63d9c860a796d765fc16c26c812 Mon Sep 17 00:00:00 2001 From: guanjihuan Date: Fri, 26 Apr 2024 12:15:50 +0800 Subject: [PATCH] Update tensorflow_example.py --- 2019.10.11_tensorflow_example/tensorflow_example.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/2019.10.11_tensorflow_example/tensorflow_example.py b/2019.10.11_tensorflow_example/tensorflow_example.py index 29a8e1f..6b7635e 100644 --- a/2019.10.11_tensorflow_example/tensorflow_example.py +++ b/2019.10.11_tensorflow_example/tensorflow_example.py @@ -7,7 +7,7 @@ The newest version of this code is on the web page: https://www.guanjihuan.com/a import tensorflow.compat.v1 as tf # 之所以这么调用,是因为tensorflow版本2.0无法兼容版本1.0 tf.compat.v1.disable_eager_execution() # 这行代码可以保证 sess.run() 能够正常运行 - +# tf.disable_v2_behavior() # 或者使用这个代码,可代替上面一行 greeting = tf.constant('Hello Google Tensorflow!') # 定义一个常量