Softology Software Gallery Contact Blog
IMPORTANT POINTS
You MUST have an Nvidia GPU for the TensorFlow related modes to work in Visions of Chaos. If you are unsure, check your graphics card is listed here.
If your graphics card is listed, check the "Compute Capability" version next to it. Your card MUST support version 3.5 or later for TensorFlow to work. If your card shows 3.0 or earlier these steps will not work.
If you do not have a supported Nvidia GPU stop now and don't bother with the rest of this page.
Version numbers are important. If these instructions specify a version number make sure you download and install that version.
These steps only seem to work on Windows 10 64-bit. I have not yet been able to get them working on earlier versions of Windows.

Movie Tutorial
The following movie explains the steps on this page in more detail.
NOTE that extra steps have been added since I made that movie. Make sure you follow the steps on this page as they will always be the most up to date.

Installing Python and TensorFlow for Visions of Chaos
Python and TensorFlow enable the machine learning and neural network features of Visions of Chaos.
Follow these steps to get TensorFlow working on your PC so Visions of Chaos can make use of it.

Python
Download Python v3.7.4 from here. Newer versions cause TensorFlow to fail so use the older version. Make sure it is the 64 bit version. If the first setup page shows 32-bit, cancel and download the 64-bit version.
Install it making sure you check the "Add Python to PATH" checkbox.
Python Install Dialog
If you also install Python outside the "Program Files" directory (eg to C:\Python\) it saves potential security rights hassles in the next stage.

Update Python Packages
If you installed Python to a directory outside "Program Files" you can copy the following commands into a command prompt windows. If you did install Python to the default subdirectory under "Program Files" you will need to run the following commands from an Administrator command prompt.
To prevent other possible access errors make sure there are no instances of python.exe running in task manager before trying these commands.
The commands can all be copied and pasted into the command line in one go and will execute one after the other.
python -m pip install --upgrade pip
pip install --no-cache-dir --ignore-installed --upgrade --force-reinstall pyyaml==5.1.2
pip install --no-cache-dir --ignore-installed --upgrade --force-reinstall tensorflow-gpu==1.14
pip install --no-cache-dir --ignore-installed --upgrade --force-reinstall tensorflow-datasets==1.2.0
pip install --no-cache-dir --ignore-installed --upgrade --force-reinstall keras==2.2.4
pip install --no-cache-dir --ignore-installed --upgrade --force-reinstall matplotlib==3.1.1
pip install --no-cache-dir --ignore-installed --upgrade --force-reinstall pillow==6.1.0
pip install --no-cache-dir --ignore-installed --upgrade --force-reinstall pydot==1.4.1
pip install --no-cache-dir --ignore-installed --upgrade --force-reinstall opencv-python==4.1.1.26
pip install --no-cache-dir --ignore-installed --upgrade --force-reinstall scipy==1.3.1
pip install --no-cache-dir --ignore-installed --upgrade --force-reinstall pandas==0.25.1
pip install --no-cache-dir --ignore-installed --upgrade --force-reinstall music21==5.7.0
pip install --no-cache-dir --ignore-installed --upgrade --force-reinstall imageio==2.6.1

If you get unsolvable errors with the pip install commands you can try uninstalling Python, deleting the Python directory, rebooting, reinstalling Python and then running the above pip install commands again.

CUDA
CUDA
Download CUDA v10.0 from here and install it.
NOTE: by default the Nvidia installer wants to install extra drivers etc, you only need the libraries option checked, ie
CUDA Install Dialog

cuDNN
1. Download cuDNN v10.0 from here. Make sure you get the version for CUDA 10.0, ie "Download cuDNN v7.6.4 (September 27, 2019), for CUDA 10.0"
You do have to register, but if you do not want to use your real name and email to register, use a fake name and a free temp mail service like temp mail or 10 minute mail to get the verification email.
2. Extract the cuDNN zip to a temp folder.
3. Copy the \cuda\bin\cudnn64_7.dll into the C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\bin\ folder.
The C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\bin\ folder should now have a bunch of DLLs and look like the following
CUDA DLLs
4. Add the CUDA bin folder (ie C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\bin) to your path.

Add CUDA to Path
1. Hold the Windows key and press Pause to bring up the System Control Panel.
2. Click Advanced system settings.
3. Click the Environment Variables button.
System Properties
4. Highlight Path in the lower "System variables" section as above and click Edit.
Environment Variables
5. Click New and add C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\bin as follows.
Path
6. Click OK, OK, OK to close all dialogs.
7. Reboot Windows.

GPT-2 Specific Install Steps
These steps are only required if you want to use the GPT-2 text generation mode in Visions of Chaos.
Download Visual Studio Community Edition from here.
Start the installer and check "Desktop developement with C++"
VS Installation
Click the "Individual Components" tab, scroll down and check the most recent "C++/CLI support" checkbox
VS Installation
Click Install.
Once the install is finished, you do not have to start Visual Studio or create an account to sign in. Just close it.
Reboot.
Now run the following pip install commands to install the packages required by GPT-2

pip install --no-cache-dir --ignore-installed --upgrade --force-reinstall fire>=0.1.3
pip install --no-cache-dir --ignore-installed --upgrade --force-reinstall regex==2017.4.5
pip install --no-cache-dir --ignore-installed --upgrade --force-reinstall requests==2.21.0
pip install --no-cache-dir --ignore-installed --upgrade --force-reinstall tqdm==4.31.1

GPT-2 should now be supported in Visions of Chaos.

Test TensorFlow Support in Visions of Chaos
Start Visions of Chaos, click the Options menu and then select Options to open the Options dialog. Under the TensorFlow tab, click the "Check and enable TensorFlow" button.
Visions of Chaos TensorFlow detection
If the installs went OK then TensorFlow should be detected and the TensorFlow functionality will be enabled in Visions of Chaos.
TensorFlow and CUDA may fail if another program is using it. If you have a problem, try rebooting and then running only Visions of Chaos and try again. If you are rendering a long movie it is best to have only Visions of Chaos running for the best chance of a trouble free result.

How Can You Use TensorFlow in Visions of Chaos
1. Cellular automata searching Select Mode->Cellular Automata->2D->2D Cellular Automata. You should see a "Search" button. Clicking that uses TensorFlow Convolutional Neural Networks to detect interesting CA rules.
2. Style Transfer GANs Select Image->Image Procesing->Style Transfer
3. LSTM Music Composer Select Mode->Music->LSTM Composer
4. DeepDream Select Image->Image Procesing->DeepDream
5. GPT-2 text generation Select Mode->Machine Learning->GPT-2 Text Generator