본문 바로가기
Active Inference

How to install Deep learning environment in ubuntu?

by sk_victoria 2023. 8. 31.

1. Move to /tmp folder in order to download and install temporary files.

cd /tmp

 

2. Update Debian packages

sudo apt update

 

3. Install curl (help sending and receiving http messages) and download sh file by using curl, or directly download from https://www.anaconda.com/products/individual

sudo apt install -y curl


sha256sum Anaconda3-2023.07-2-Linux-x86_64.sh # check checksum

sh Anaconda3-2023.07-2-Linux-x86_64.sh

source ~/.bashrc​ # update environment variable in bashrc

 

4. Create Virtual environment named env, and install pytorch inside it.

conda create -n env python=3.9 # vscode does not support ver.<=3.6 anymore!

conda activate env

conda install pytorch torchvision torchaudio pytorch-cuda=11.7 -c pytorch -c nvidia

 

5. Install software needed using conda.

  • If you want to upgrade the version of python, just create another environment.
# PILLOW
conda install -c anaconda pillow

# matplotlib
conda install -c conda-forge matplotlib

# opencv
conda install --channel https://conda.anaconda.org/menpo opencv3
conda install -c menpo opencv

# vim
conda install -c conda-forge vim

# sshpass (ssh with password in one line)
conda install -c conda-forge sshpass

# tensorboard
conda install -c conda-forge tensorboard

 


Useful tips for Virtual Environment using Conda

conda create -n $env python=$version # create environment

conda env list # check environment list

conda activate $env # start environment

conda deactivate # terminate environment

conda remove -n $env --all # remove the environment. MAKE SURE CURRENT ENV BE (BASE)

댓글