Softology Software Gallery Contact Blog
IMPORTANT POINTS
You MUST have an NVIDIA GPU for the Machine Learning related modes to work in Visions of Chaos. If you do not have a supported NVIDIA GPU stop now and don't bother with the rest of this page.
If you do have an NVIDIA brand GPU, check its "Compute Capability" version here. Your card MUST support version 3.5 or later for the machine learning to work. If your card shows 3.0 or earlier these steps will not work.
The required programs, Python libraries and machine learning models will require around 45 GB of disk space.
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.
I have tested and confirmed these steps work on PCs using 1080, 2080 Super and 3090 RTX GPUs.
https://youtu.be/kvChFdI6EqY
YouTube Tutorial
The following movie demonstrates the steps on this page. NOTE that the steps on this page should always be followed in preference to the video as this page will always have the latest up to date instructions. If in doubt, always follow the steps on this page.

Update Your GPU Drivers
Select Help->Update Graphics Card Drivers from Visions of Chaos. That will show you which model GPU you have and open the NVIDIA download page.
Once the download page opens, select your model GPU and click Search. The recommended driver will appear. Download and install it and the reboot.

CUDA
Download CUDA v11.2.2 March 2021 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 v8.1.0 (January 26th, 2021) for CUDA 11.0,11.1 and 11.2 from here.
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 all the the \cuda\bin\ DLLs from the extracted zip into the C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\bin\ folder.

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 and click Edit.
Environment Variables
5. Click New and add C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\bin as follows.
Path
6. Click OK, OK, OK to close all dialogs.
7. Reboot Windows.

Visual Studio Community Edition
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.

Image Magick
Download the latest 64 bit HDR version of Image Magick from here.
Start the installer and select the following install components. You can leave everything else at the defaults.
Image Magick installation

Python
Download Python v3.9.x from here. Make sure it is the 64 bit version. If the first setup page shows 32-bit, cancel and download the 64-bit version. When I last installed and did the screen capture it was 3.9.3, but since then it is not available and now it is 3.9.4. Any 3.9 version should be fine.
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 pip install 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 sub-directory 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 tensorflow==2.5.0rc2
pip install --no-cache-dir --ignore-installed --upgrade --force-reinstall tensorflow-datasets==4.2.0
pip install --no-cache-dir --ignore-installed --upgrade --force-reinstall keras==2.4.3
pip install --no-cache-dir --ignore-installed --upgrade --force-reinstall matplotlib==3.4.1
pip install --no-cache-dir --ignore-installed --upgrade --force-reinstall pillow==8.2.0
pip install --no-cache-dir --ignore-installed --upgrade --force-reinstall pydot==1.4.2
pip install --no-cache-dir --ignore-installed --upgrade --force-reinstall opencv-python==4.5.1.48
pip install --no-cache-dir --ignore-installed --upgrade --force-reinstall scipy==1.6.2
pip install --no-cache-dir --ignore-installed --upgrade --force-reinstall scikit-image==0.18.1
pip install --no-cache-dir --ignore-installed --upgrade --force-reinstall pandas==1.2.3
pip install --no-cache-dir --ignore-installed --upgrade --force-reinstall imageio==2.9.0
pip install --no-cache-dir --ignore-installed --upgrade --force-reinstall fire==0.4.0
pip install --no-cache-dir --ignore-installed --upgrade --force-reinstall pyyaml==5.4.1
pip install --no-cache-dir --ignore-installed --upgrade --force-reinstall h5py==3.1.0
pip install --no-cache-dir --ignore-installed --upgrade --force-reinstall numpy==1.19.2
pip install --no-cache-dir --ignore-installed --upgrade --force-reinstall regex==2021.3.17
pip install --no-cache-dir --ignore-installed --upgrade --force-reinstall requests==2.25.1
pip install --no-cache-dir --ignore-installed --upgrade --force-reinstall tqdm==4.59.0
pip install --no-cache-dir --ignore-installed --upgrade --force-reinstall click==7.1.2
pip install --no-cache-dir --ignore-installed --upgrade --force-reinstall psutil==5.8.0
pip install --no-cache-dir --ignore-installed --upgrade --force-reinstall ninja==1.10.0.post2
pip install --no-cache-dir --ignore-installed --upgrade --force-reinstall siren_pytorch==0.1.5
pip install --no-cache-dir --ignore-installed --upgrade --force-reinstall torch_optimizer==0.1.0
pip install --no-cache-dir --ignore-installed --upgrade --force-reinstall ftfy==6.0.1
pip install --no-cache-dir --ignore-installed --upgrade --force-reinstall boto3==1.17.60
pip install --no-cache-dir --ignore-installed --upgrade --force-reinstall pymoo==0.4.2.2
pip install --no-cache-dir --ignore-installed --upgrade --force-reinstall kornia==0.5.1
pip install --no-cache-dir --ignore-installed --upgrade --force-reinstall pytorch-pretrained-biggan==0.1.1
pip install --no-cache-dir --ignore-installed --upgrade --force-reinstall omegaconf==2.0.6
pip install --no-cache-dir --ignore-installed --upgrade --force-reinstall pytorch-lightning==1.3.0
pip install --no-cache-dir --ignore-installed --upgrade --force-reinstall ipython==7.23.0
pip install --no-cache-dir --ignore-installed --upgrade --force-reinstall ipywidgets==7.6.3
pip install --no-cache-dir --ignore-installed --upgrade --force-reinstall DALL-E==0.1
pip install --no-cache-dir --ignore-installed --upgrade --force-reinstall adamp==0.3.0
pip install --no-cache-dir --ignore-installed --upgrade --force-reinstall sentence_transformers==2.0.0
pip install --no-cache-dir --ignore-installed --upgrade --force-reinstall lpips==0.1.3
pip install --no-cache-dir --ignore-installed --upgrade --force-reinstall easing-functions==1.0.4
pip uninstall -y torch
pip uninstall -y torch
pip install --no-cache-dir --ignore-installed --upgrade --force-reinstall torch==1.8.1+cu111 torchvision==0.9.1+cu111 torchaudio===0.8.1 -f https://download.pytorch.org/whl/torch_stable.html

If you get errors about dependency conflicts they can be ignored. Getting all of those libraries to install without errors and/or warnings seems almost impossible. If you are unsure, try the rest of the steps first and then try running one of the Machine Learning modes.

If you get unsolvable errors with the pip install commands or the Python libraries when trying to run the scripts you can "reset" Python by following these steps;
1. Uninstall Python
2. Delete the directory that you installed Python into
3. Windows-R, %temp% to open your temp folder. Delete all the files within it
4. Delete the directory C:\Users\yourusername\AppData\Local\torch_extensions
5. Reboot
6. Install Python and the pip commands again
7. Reboot and then try the Machine Learning modes again

Test Machine Learning Support in Visions of Chaos
Start Visions of Chaos, click the Options menu and then select Options to open the Options dialog. Under the Machine Learning tab, click the "Check and enable Machine Learning modes" button.
Visions of Chaos Machine Learning detection
If the installs went OK then the Machine Learning 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. DeepDream Select Image->Image Processing->DeepDream
4. GPT-2 text generation Select Mode->Machine Learning->TensorFlow->GPT-2 Text Generator
5. Text-To-Image Select Mode->Machine Learning->PyTorch->GPT-2 Text Generator