keras包安装
2016-07-05 14:59
330 查看
Keras is a minimalist, highly modular neural networks library, written in Python and capable of running on top of either TensorFlow or Theano. It was developed with a focus on enabling fast experimentation. Being able to go from idea to result with the least possible delay is key to doing good research.
使用pip安装keras包,安装过程会自动下载安装theano。
但是在导入keras运行代码的时候,出现如下警告:
WARNING (theano.configdefaults): g++ not detected ! Theano will be unable to execute optimized C-implementations (for both CPU and GPU) and will default to Python implementations. Performance will be severely degraded. To remove this warning, set Theano flags cxx to an empty string.
从http://www.cnblogs.com/anyview/p/5063189.html这篇博客中找到了解决办法:
安装完成之后就可以了。
后面由于要使用NLTK中定义的stopwords,又出错了。
使用代码如下:
报错信息如下:
这是由于本地没有stopwords的语料库,所以在使用的时候就会报错,按照stackoverflow上的一个回答完美地解决了这个问题,网址是:
http://stackoverflow.com/questions/26693736/nltk-and-stopwords-fail-lookuperror
解决办法如下:
在Python console中输入上面两行代码之后会弹出一个如下所示的GUI:
可以自己选择需要下载的语料和下载到的位置。
也可以直接使用
OK,这是今天干活的过程中遇到的几个小问题,记录一下~
使用pip安装keras包,安装过程会自动下载安装theano。
>>> pip install keras
但是在导入keras运行代码的时候,出现如下警告:
WARNING (theano.configdefaults): g++ not detected ! Theano will be unable to execute optimized C-implementations (for both CPU and GPU) and will default to Python implementations. Performance will be severely degraded. To remove this warning, set Theano flags cxx to an empty string.
从http://www.cnblogs.com/anyview/p/5063189.html这篇博客中找到了解决办法:
>>> conda install mingw libpython
安装完成之后就可以了。
后面由于要使用NLTK中定义的stopwords,又出错了。
使用代码如下:
>>> from nltk.corpus import stopwords >>> stop = stopwords.words('english')
报错信息如下:
LookupError: ******************************************** Resource 'corpora/stopwords' not found. Please use the NLTK Downloader to obtain the resource: >>> nltk.download() Searched in: - 'C:\\Users\\Meru/nltk_data' - 'C:\\nltk_data' - 'D:\\nltk_data' - 'E:\\nltk_data' - 'C:\\Users\\Administrator\\Anaconda\\nltk_data' - 'C:\\Users\\Administrator\\Anaconda\\lib\\nltk_data' - 'C:\\Users\\Administrator\\AppData\\Roaming\\nltk_data' ********************************************
这是由于本地没有stopwords的语料库,所以在使用的时候就会报错,按照stackoverflow上的一个回答完美地解决了这个问题,网址是:
http://stackoverflow.com/questions/26693736/nltk-and-stopwords-fail-lookuperror
解决办法如下:
>>> import nltk >>> nltk.download()
在Python console中输入上面两行代码之后会弹出一个如下所示的GUI:
可以自己选择需要下载的语料和下载到的位置。
也可以直接使用
nltk.download("stopwords")下载停用词语料,默认的下载地址是’C:\Users\Administrator\AppData\Roaming\nltk_data…’
OK,这是今天干活的过程中遇到的几个小问题,记录一下~
相关文章推荐
- Python动态类型的学习---引用的理解
- Python3写爬虫(四)多线程实现数据爬取
- 垃圾邮件过滤器 python简单实现
- 下载并遍历 names.txt 文件,输出长度最长的回文人名。
- install and upgrade scrapy
- Scrapy的架构介绍
- Centos6 编译安装Python
- 使用Python生成Excel格式的图片
- 让Python文件也可以当bat文件运行
- [Python]推算数独
- Python中zip()函数用法举例
- Python中map()函数浅析
- Python将excel导入到mysql中
- Python在CAM软件Genesis2000中的应用
- 使用Shiboken为C++和Qt库创建Python绑定
- FREEBASIC 编译可被python调用的dll函数示例
- Python 七步捉虫法