appendix Installing PyTorch and enabling GPU training locally and in Colab
My preferred way of installing Python and managing libraries and packages on your computer is through Anaconda, an open source Python distribution, package manager, and environment management tool. Anaconda is user-friendly and can help you effortlessly install numerous libraries and packages, which could be a pain to install otherwise. Anaconda allows you to install packages through both conda install and pip install, broadening the spectrum of available resources.
I’ll also walk you through the steps in creating a dedicated Python virtual environment for all the projects in this book. This segregation ensures that the libraries and packages used in this book remain isolated from any libraries used in other, unrelated projects, thus eliminating any potential interference. However, you can choose your own way of installing Python and creating a virtual environment on your computer for projects in this book.
We’ll use Jupyter Notebook as our integrated development environment (IDE). I’ll guide you through the installation of Jupyter Notebook in the Python virtual environment you just created. You’ll also learn to check if your computer is equipped with a Compute Unified Device Architecture (CUDA)-enabled GPU. If yes, you’ll learn to install PyTorch, TorchVision, and TorchAudio on your computer.