Skip to content

Anaconda

Hye Min edited this page Nov 22, 2018 · 5 revisions

Anaconda and switching between tensorflow versions

Anaconda is a software that allows one machine to quickly switch between different software version configurations without having to install/deinstall every time. For purposes of REAS_MI it allows us to switch between different tensorflow versions (and versions of its dependencies) required for different MI algorithms. Each set of configuration is called an environment.

To switch to an environment:

source activate <name_of_the_env>

To switch out of the environment:

source deactivate

To see a list of environments:

conda env list

For progressiveGAN use source activate progressive_gan2. For DCGAN and others call source deactivate twice to entirely exit out of anaconda.

More commands can be found here.

Scope of an environment:

An activated environment only affects that specific terminal instance. There can be multiple terminals open at the same time with different environments. When an environment is activated, each line from the terminal is preceded by the environment name. For example, with progressive_gan2:

username@computer-name:/current/path/to/dir$ source activate progressive_gan2
(progressive_gan2) username@computer-name:/current/path/to/dir$
(progressive_gan2) username@computer-name:/current/path/to/dir$ dir folder
(progressive_gan2) username@computer-name:/current/path/to/dir/folder$

When an environment is activated, everything installed through pip for example will only effect that environment.

GPU driver:

One essential software that is required by tensorflow GPU version that cannot be managed by Anaconda is NVIDIA GPU driver. Higher version of the driver for the most part will be backwards compatible and will work with lower versions of Cuda-toolkit and Cudnn. To upgrade the driver:

sudo apt-get purge nvidia-*
sudo apt-get install nvidia-<newer_driver_#>

For example, to install driver version 410 (current version installed on the Alienware):

sudo apt-get install nvidia-410