Skip to content

Commit 9232338

Browse files
committed
修改tf1.py的错误
由于使用TensorFlow2导致的问题。
1 parent d281556 commit 9232338

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ch01/tf1.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import tensorflow as tf
2-
assert tf.__version__.startswith('1.')
1+
import tensorflow.compat.v1 as tf
2+
tf.disable_v2_behavior()
3+
assert tf.__version__.startswith('2.')
34

45
# 1.创建计算图阶段
56
# 创建2个输入端子,指定类型和名字

0 commit comments

Comments
 (0)