CUDA Environment "runbook" for PL 0.13.1

I gave a “runbook” for setting up an environment on windows for V0.11.8 a long time ago, so now I’m updating it - the original post still has useful info in it so today I’m just giving the content of my Windows batch file for creating an environment…

I’m updating it because @Jwalker encountered some issues with the required cuda for TF 2.5 (change of channel for cudatoolkit) and it seemed worthwhile to just give it all again…

You will need to edit a few things (path to activate.bat), and you may want to add your own preferred packages and skip some of mine, but here it is…

NB I have just edited it to make it more specific here - I might have introduced some errors: nothing terrible I hope, but, just in case :slight_smile:

NB 2 thanks to a reminder from @JWalker, you might need to run the conda installations for cuda with admin privileges - and obviously you can use tensorflow-gpu if you have a GPU (it is still available) but according to Google the basic tensorflow package handles both CPU and GPU now, so pip install tensorflow==2.5.0 should suffice

@echo off
REM conda options -y = yes, i.e. no confirmation; -q = quiet, i.e. no progress bar
REM pip options -q = quiet

set envName= YOURNAMEHERE 

REM minimal set of conda installations especially cuda support for TensorFlow
REM conda -c and the channel name must be adjacent
echo Conda stuff - create and activate environment %envName%
call conda create -y -q --name %envName% -c conda-forge python==3.8.10

REM Change path to activate.bat as necessary
call C:\Users\Julian\anaconda3\Scripts\activate.bat %envName%
echo Adding cuda support
call conda install -y -q -c conda-forge cudatoolkit=11.2.2
call conda install -y -q -c conda-forge cudnn=

REM pip installations
echo Pip stuff - after updating pip, setuptools install PerceptiLabs/TensorFlow and additional packages to taste
pip install -q --upgrade pip setuptools

REM installing Perceptilabs will bring in tensorflow... but there are some useful TF extras afterwards
REM tensorflow-gan (has a dependency on TFP) - see
REM TFP must now have an explicit version to be compatible with TF 2.5 since latest versions are TF2.6 and later
REM tensorflow_decision_forests (TF-DF) not available for Windows or Mac yet; see

pip install -q --no-input perceptilabs
pip install -q --no-input tensorflow-probability==0.13.0 tensorflow-addons tensorflow-gan

REM Additional packages - ipython notebook, nice plotting with seaborn, some UI...
pip install -q jupyterlab
pip install -q --no-input seaborn tabulate pandoc
pip install -q ipyfilechooser tqdm wget

REM if jupyterlab is installed this provides syntax checking etc.
REM see
echo Install Language Server Protocol for jupyter & python specifics
echo The extension @krassowski/jupyterlab-lsp is also required
echo (ditto @jupyter-widgets/jupyterlab-manager but these should have come automatically)
pip install jupyterlab-lsp python-lsp-server[all]

1 Like