Theano: change `base_compiledir` to save compiled

2020-07-18 05:56发布

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

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 does explain ways for configuring theano in some aspect but I still couldn't address my question.

I am using Ubuntu.

Thanks & Cheers!

标签: python theano
1条回答
贪生不怕死
2楼-- · 2020-07-18 06:33

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.

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

export THEANO_FLAGS="base_compiledir=/some/path"

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

[global]
base_compiledir=/some/path

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

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.

查看更多
登录 后发表回答