您的位置:首页 > 其它

ubuntu16.04 keras程序运行报错和解决

2017-09-25 15:48 274 查看
为了实现神经网络的Dropout随机失活,在网上搜了神经网络的Dropout正则化,它使用keras实现,我的tensorflow环境没有keras,因此安装:

在ubuntu终端输入source activate tensorflow,激活tensorflow环境,然后使用pip install keras安装,安装成功之后在pycharm import keras不报错;

实现链接中的代码并运行:

报错:

tensorflow.python.framework.errors_impl.NotFoundError: /home/rh/Applications/Anaconda/anaconda3/lib/python3.5/site-packages/tensorflow/contrib/cudnn_rnn/python/ops/_cudnn_rnn_ops.so: cannot open shared object file: No such file or directory

解决方式:
Which tensorflow pip package did you install? -- I just realized you installed through conda. The packages in conda are community maintained, so I am not sure what might be wrong there. Is it possible for you to try a pip install,
maybe in a clean conda environment? the command should be
:pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorfl‌​ow-0.12.1-cp35-cp35m‌​-linux_x86_64.whl(在tensorflow1环境下)[/code] 
但是运行到一半在终端报错了,没管,再一次用pycharm运行程序


报错:setuptools-27.2.0-py3.5.egg

解决方式:

1. 下载ez_setup.py。Linux下可使用此命令: wget -q http://peak.telecommunity.com/dist/ez_setup.py

2. 运行ez_setup.py:python ez_setup.py  ;如果运行正常,那就安装成功了。
(在tensorflow1环境下)

但是终端还是报错,没管,再一次运行pycharm

报错:keras sigmoid_cross_entropy_with_logits() got an unexpected keyword argument 'labels'

解决方式:

基于Tensorflow的keras运行错误解决方案

终端运行没有报错,运行pycharm,成功
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐