安装keras的坑--pip install安装成功后显示No model named keras

据说keras使用非常方便,安装使用下,之前安装tensorflow==1.3.0(这为后面埋了个坑。。。。)和不同版本的python
pip3 install keras
安装后import keras [1]
没问题哇,但是,运行代码后报错:No model named keras

find /  -name keras

发现安装到python3.5下面去了。。。。我用python3.6,重新安装,指定pip3路径,然后,还是。。。。
想着是不是keras版本不匹配tensorflow==1.3.0的原因,查看版本,

>>> import tensorflow
>>> print(tensorflow.__version__)
1.3.0
>>> import keras
/home/duhj/anaconda3/lib/python3.6/site-packages/h5py/__init__.py:34: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters
Using TensorFlow backend.
>>> print(keras.__version__)
2.2.2

将keras重装,

pip3.6 install keras==2.1.6

然后再测试lstm+cnn模型[2],运行成功。
在这里插入图片描述
Ref:
[1] https://keras-cn.readthedocs.io/en/latest/for_beginners/keras_linux/
[2] https://github.com/keras-team/keras

  • 5
    点赞
  • 20
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值