ML Environment

From CCN Wiki
Jump to navigation Jump to search

The lab primarily uses a Linux environment. We have several workstations running the latest version of Ubuntu. Our machine learning (ML) research is primarily carried out using Google's TensorFlow libraries, written for Python. Workstations with powerful GPUs can use CUDA for GPU acceleration.

Below are the specs and walkthrough for setting up a modest ML programming environment.

Hardware

There are no particular hardware requirements for running TensorFlow. Obviously, more disk space and RAM are desirable, as is a CUDA-enabled GPU.

Operating System

The closed Apple ecosystem might make MacOS a good choice of platform because a Mac is a Mac is a Mac. However, I'm not Mr. Moneybags over here, and Apple drops support for older hardware after a time. You couldn't pay me to use Windows for anything but Office applications, so that leaves Linux. The TensorFlow installation directions assume Ubuntu 16.04 or higher, and though I have dabbled with Debian Linux for a home media server, I typically use Ubuntu. These instructions assume Ubuntu 22.04 LTS.

Python Version

Ubuntu 22.04 has retired Python 2.x, and uses Python 3.9 by default, which works nicely with TensorFlow (I understand that getting TensorFlow to work with Python 3.10+ includes some challenges). These instructions assume Python 3.9. If you want to use other versions of Python for other applications, I recommend using virtual environments to manage and switch between Python versions. The installation instructions use miniconda to create a Python 3.9 virtual environment.

Setup

TensorFlow Installation

First off, you can use Conda, but don't use Conda to install TensorFlow. Instead, follow the pip install instructions published by the TensorFlow people.

Spyder Installation

Anthony got me using the Spyder IDE for Python programming. Problem is, as of today (July 6, 2022), it's buggy on Ubuntu 22.04. Don't bother using the apt package. Instead, you can install it using pip, as documented here:

pip install -U spyder

After installation, you can launch it from a terminal window:

user@host:~ spyder