Ubuntu16.04lts 安装Theano配置GPU

参考文献:jteng的专栏-http://blog.csdn.net/jteng/article/details/52075871

根据jteng分享的安装步骤,第一次安装并没有成功。

XXX:~$ python
Python 2.7.13 |Anaconda 4.4.0 (64-bit)| (default, Dec 20 2016, 23:09:15) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org
>>> import theano
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/seanow/anaconda2/lib/python2.7/site-packages/theano/__init__.py", line 45, in <module>
    from theano.configdefaults import config
  File "/home/seanow/anaconda2/lib/python2.7/site-packages/theano/configdefaults.py", line 17, in <module>
    from theano.configparser import (AddConfigVar, BoolParam, ConfigParam, EnumStr,
  File "/home/seanow/anaconda2/lib/python2.7/site-packages/theano/configparser.py", line 86, in <module>
    theano_cfg.read(config_files)
  File "/home/seanow/anaconda2/lib/python2.7/ConfigParser.py", line 305, in read
    self._read(fp, filename)
  File "/home/seanow/anaconda2/lib/python2.7/ConfigParser.py", line 512, in _read
    raise MissingSectionHeaderError(fpname, lineno, line)
ConfigParser.MissingSectionHeaderError: File contains no section headers.
file: /home/seanow/.theanorc, line: 1
'\xe2\x80\x83\xe2\x80\x83[global]\n'
>>> 

分析错误原因:

安装环境区别如下:

jteng的安装环境:Ubuntu16.04lts 64位系统,NVIDIA Geforce 840M,Anaconda Python 3.5,Cuda7.5。

我的安装环境:Ubuntu16.04lts 64位系统,NVIDIA Geforce 965M,Anaconda Python 2.7,Cuda7.5。

当运行以下代码时,出现以下问题:

XXX:~$ sudo gedit ~/.theanorc
[sudo] XXX 的密码: 
 

(gedit:10052): Gtk-WARNING **: Calling Inhibit failed: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files

** (gedit:10052): WARNING **: Set document metadata failed: 不支持设置属性 metadata::gedit-spell-enabled

** (gedit:10052): WARNING **: Set document metadata failed: 不支持设置属性 metadata::gedit-encoding

** (gedit:10052): WARNING **: Set document metadata failed: 不支持设置属性 metadata::gedit-position

百度之后:https://askubuntu.com/questions/419783/gtk-warning-calling-inhibit-failed-gdbus-errororg

看到类似问题,大神给的答案是:use gksudo or gksuinstead of sudo to open the file,

XXX:~$ gksudo gedit ~/.theanorc
程序“gksudo”尚未安装。 您可以使用以下命令安装:
sudo apt install gksu

………………………………………………
(安装过程)
………………………………………………
XXX:~$ gksudo gedit ~/.theanorc

** (gedit:10924): WARNING **: Set document metadata failed: 不支持设置属性 metadata::gedit-spell-enabled

** (gedit:10924): WARNING **: Set document metadata failed: 不支持设置属性 metadata::gedit-encoding

** (gedit:10924): WARNING **: Set document metadata failed: 不支持设置属性 metadata::gedit-position

此时,第一个错误消失。后几个问题经多处查询,未找到合适答案,未能解决。网友提示可以忽略,事实的确不影响后续结果,但希望有高手给予解决。

再次运行 import theano

Using gpu device 0: GeForce GTX 965M (CNMeM is disabled, cuDNN not available)

表明安装成功!

转载于:https://my.oschina.net/u/3083178/blog/1499793

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值