代码实践《tensorflow实战GOOGLE深度学习框架》时,由于本机安装的tensorflow为2.0版本与配套书籍代码1.4的API不兼容,只得将tensorflow降级为1.4.0版本使用,降级方法如下
1 pip uninstall tensorflow
2 pip install tensorflow==1.14.0 -i https://pypi.tuna.tsinghua.edu.cn/simple
验证
import tensorflow as tf
print(tf.version)