代码实践《tensorflow实战GOOGLE深度学习框架》时,由于本机安装的tensorflow为2.0版本与配套书籍代码1.4的API不兼容,只得将tensorflow降级为1.4.0版本使用,降级方法如下
1 pip uninstall tensorflow

tensorflow2.0降级
2 pip install tensorflow==1.14.0 -i https://pypi.tuna.tsinghua.edu.cn/simple

tensorflow2.0降级
验证

import tensorflow as tf
print(tf.version)
tensorflow2.0降级

相关文章: