Search code examples
windowstheano

In windows, where to create the `.theanorc.txt` file and how to make theano able to see it?


I am trying to make thenao use gpu on windows. This tutorial suggests that I create a .theanorc directory at my home and a theanorc.txt inside it to be able to set the configuration flags before initialization.

Where to create the theanorc.txt file (i.e. how to find out where my home is?) and how to make theano able to see it? I have tried the following script to create .theanorc and then added theanorc.txt manually inside it, but gpu was not enabled:

import os
_theano_base_dir = os.path.expanduser('~')
if not os.access(_theano_base_dir, os.W_OK):
    _theano_base_dir = '/tmp'

_theano_dir = os.path.join(_theano_base_dir, '.theanorc')
if not os.path.exists(_theano_dir):
    os.makedirs(_theano_dir)

theano_config_path = os.path.expanduser(os.path.join(_theano_dir, 'theanorc.txt'))
print (theano_config_path)

This printed: C:\SPB_Data\.theanorc\theanorc.txt Is C:\SPB_Data my home?


Solution

  • In Windows, your home directory should be C:\Users\Your_Windows_UserName. Also if you want to create the .theanorc file without the .txt extension you can use Notepad++