TensorFlow1.4.0+Keras2.0.82.0.8onPython3.6.on

2022-07-03

记录,自用

1、安装Anaconda(这里安装的是python3.6版本)

2、创建tensorflow的conda环境

1 conda create -n tensorflow python=3.6

3、切换到上一步创建的名为“tensorflow”的python解释器环境

1 activate tensorflow

4、分别安装tensorflow和keras

版本兼容性参考:

这里选择TensorFlow 1.4.0 + Keras 2.0.8 on Python 3.6.

1 pip install tensorflow==1.4.0
2 pip install keras==2.0.8 

5、遇到问题1

在该环境使用python解释器,可以正常使用tensorflow

当在该环境下打开jupyter notebook,运行import tensorflow as tf,报错

“ImportError: No module named tensorflow”

解决方案:

1 conda install nb_conda

6、遇到问题2

执行“import tensorflow as tf”后遇到

FutureWarning: Passing (type, 1) or ‘1type’ as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / ‘(1,)type’._np_quint8 = np.dtype([(“quint8”, np.uint8, 1)])的错误

解决方案:降低numpy版本

1 pip install numpy==1.16.0

7、成功

分类:

技术点:

相关文章:

© 版权声明
THE END
喜欢就支持一下吧
点赞174赞赏 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情代码图片

    暂无评论内容