Theano:更改`base_compiledir` 以将编译后的文件保存在另一个目录中 [英] Theano: change `base_compiledir` to save compiled files in another directory

查看:27
本文介绍了Theano:更改`base_compiledir` 以将编译后的文件保存在另一个目录中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

theano.base_compiledir 是指存放编译文件的目录.

theano.base_compiledir refers to the directory where the compiled files are stored.

有没有办法可以将 theano.base_compiledir 永久设置到不同的位置,也许是通过修改一些内部 theano 文件的内容?

Is there a way where I could permanently set theano.base_compiledir to a different location, perhaps by modifying the content of some internal theano files ?

http://deeplearning.net/software/theano/library/config.html 确实在某些方面解释了配置 theano 的方法,但我仍然无法解决我的问题.

http://deeplearning.net/software/theano/library/config.html does explain ways for configuring theano in some aspect but I still couldn't address my question.

我使用的是 Ubuntu.

I am using Ubuntu.

谢谢&干杯!

推荐答案

作为文档 解释说,您可以通过更改 THEANO_FLAGS 环境变量(例如在您的 ~/.bashrc 文件中)或使用 ~/.theanorc 文件.

As the documentation explains, you can set this, or any other Theano config flag, permanently by altering either the THEANO_FLAGS environment variable (e.g. in your ~/.bashrc file) or using a ~/.theanorc file.

对于前者,在您的 ~/.bashrc 文件中添加如下一行:

For the former, add a line like this to your ~/.bashrc file:

export THEANO_FLAGS="base_compiledir=/some/path"

对于后者,创建一个 ~/.theanorc 文件,其内容如下所示:

For the latter, create a ~/.theanorc file with contents that look like this:

[global]
base_compiledir=/some/path

在任何一种情况下,您可能都希望添加一堆其他标志,例如 device=floatX= 等.

In either case, you'll probably want to add a bunch of other flags such as device=, floatX=, etc.

如果你改变了你的 ~/.bashrc 文件,这些变化不会在任何活动的终端中生效,除非你在每个终端中运行 source ~/.bashrc 或者只是简单地运行关闭终端并启动新终端.

If you alter your ~/.bashrc file the changes won't take effect in any active terminals unless you run source ~/.bashrc in each one or simply close the terminals and start new ones.

这篇关于Theano:更改`base_compiledir` 以将编译后的文件保存在另一个目录中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆