本文介绍了安装Keras时出现Linux错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Ubuntu服务器上安装Keras时,出现这个奇怪的错误:

I am getting this strange to me error when installing Keras on an Ubuntu server:

Cythonizing /tmp/easy_install-qQggXs/h5py-2.5.0/h5py/utils.pyx
In file included from /usr/local/lib/python2.7/dist-packages/numpy/core/include/numpy/ndarraytypes.h:1804:0,
                 from /usr/local/lib/python2.7/dist-packages/numpy/core/include/numpy/ndarrayobject.h:17,
                 from /usr/local/lib/python2.7/dist-packages/numpy/core/include/numpy/arrayobject.h:4,
                 from /tmp/easy_install-qQggXs/h5py-2.5.0/h5py/api_compat.h:26,
                 from /tmp/easy_install-qQggXs/h5py-2.5.0/h5py/defs.c:287:
/usr/local/lib/python2.7/dist-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
 #warning "Using deprecated NumPy API, disable it by " \
  ^
In file included from /tmp/easy_install-qQggXs/h5py-2.5.0/h5py/defs.c:287:0:
/tmp/easy_install-qQggXs/h5py-2.5.0/h5py/api_compat.h:27:18: fatal error: hdf5.h: No such file or directory
 #include "hdf5.h"
                  ^
compilation terminated.
error: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

有什么想法可以解决此问题吗?

Any ideas how to fix this issue?

我已经从 https://github.com/fchollet/keras 下载了Keras存储库,并且使用此命令来安装它:

I've downloaded Keras repository from https://github.com/fchollet/keras, and used this command to install it:

sudo python setup.py install

我的Linux规范是:

My Linux specifications are:

  • 发行商ID: Ubuntu
  • 说明: Ubuntu 14.04.2 LTS
  • 发布: 14.04
  • 代号:可信任
  • Distributor ID: Ubuntu
  • Description: Ubuntu 14.04.2 LTS
  • Release: 14.04
  • Codename: trusty

推荐答案

您需要安装 hdf5 包以获取所需的标题.

You need to install the hdf5 package to get the headers you need.

这篇关于安装Keras时出现Linux错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 04:55