Theano: change `base_compiledir` to save compiled files in another directory

ぐ巨炮叔叔 提交于 2019-12-06 05:35:26

问题


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!


回答1:


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.



来源:https://stackoverflow.com/questions/34346839/theano-change-base-compiledir-to-save-compiled-files-in-another-directory

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!