When installing Theano anaconda automatically tries to install pygpu despite this being an optional dependency. I have deleted the .theanorc file from my windows user directory.
Also when running my application Theano tries to load from the GPU. It's like it remembers somehow?
conda install theano
Fetching package metadata .............
Solving package specifications: .
Package plan for installation in environment
C:\Users\zebco\Miniconda3\envs\py35:
The following NEW packages will be INSTALLED:
libgpuarray: 0.6.9-vc14_0
pygpu: 0.6.9-py36_0
theano: 0.9.0-py36_0
Proceed ([y]/n)?
As you can see I've only specified to install theano yet conda wants to install everything including optional dependancies.
Your assumption that
pygpuis optional is dependent on the package manager you are using.Regular Python (pip)
If you are using a direct Python install (obtained using brew or Python site) then you would be using
pipto installtheano. This basically comes fromhttps://pypi.python.org/pypi/Theano/1.0.0
If you download the file and unzip it. Open
setup.py, you will see below linesSo they are set as the dependencies for this package. Which means when you install
theanoyou will also getnumpy,scipyandsix.Anaconda Python (conda)
Now coming to Anaconda python. Anaconda doesn't use a package format that PyPI or pip uses. It uses its own format. In case of Anaconda you should be using
condato install the packages you need and not pip.Conda has channels which is nothing but a repository which has some packages available. You can install a package from any channel using below
The default channel is
conda-forge. If you look at thetheanopackage over therehttps://anaconda.org/conda-forge/theano/files
And download and extract it. There will be a
info/recipe/meta.ymlfile. You will notice below content in the sameWhich specifies that if you want to run this package then
pygpuis also on of its dependencies. So conda downloadspygpuas a dependency which you though was optional (which is probably true if you were using regular python and pip)