提交 69f1c9a3 authored 作者: Frédéric Bastien's avatar Frédéric Bastien

allow .theanorc.txt being used by default on windows.

上级 0995c896
...@@ -283,16 +283,15 @@ Windows V1(bigger install, but simpler instruction + try instruction for gpu) ...@@ -283,16 +283,15 @@ Windows V1(bigger install, but simpler instruction + try instruction for gpu)
(installation folder of theano) (installation folder of theano)
In the USERPROFILE directory In the USERPROFILE directory
you should create a configuration file .theanorc with the following you should create a configuration file .theanorc.
.theanorc.txt is also accepted on Windows if the environment
variable THEANORC is not set. The file should have the following
two lines: two lines:
.. code-block:: bash .. code-block:: bash
[blas] [blas]
ldflags = ldflags =
(Create a text file in Windows Explorer and rename it from the DOS
box: "ren xyz.txt .theanorc".)
Space or non ascii caracter are not always supported. If that is your case, Space or non ascii caracter are not always supported. If that is your case,
Set the environment variable 'THEANO_FLAGS' to the value 'blas.ldflags=' Set the environment variable 'THEANO_FLAGS' to the value 'blas.ldflags='
......
...@@ -27,6 +27,9 @@ THEANO_FLAGS=os.getenv("THEANO_FLAGS","") ...@@ -27,6 +27,9 @@ THEANO_FLAGS=os.getenv("THEANO_FLAGS","")
# precedence over those in files on the left. # precedence over those in files on the left.
def config_files_from_theanorc(): def config_files_from_theanorc():
rval = [os.path.expanduser(s) for s in os.getenv('THEANORC', '~/.theanorc').split(os.pathsep)] rval = [os.path.expanduser(s) for s in os.getenv('THEANORC', '~/.theanorc').split(os.pathsep)]
if os.getenv('THEANORC') is None and sys.platform=="win32":
#To don't need to change the filename and make it open easily
rval.append(os.path.expanduser('~/.theanorc.txt'))
return rval return rval
theano_cfg = ConfigParser.SafeConfigParser() theano_cfg = ConfigParser.SafeConfigParser()
theano_cfg.read(config_files_from_theanorc()) theano_cfg.read(config_files_from_theanorc())
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论