...
| Code Block | ||||
|---|---|---|---|---|
| ||||
# create a python environment $ python3 -m venv .venv # activate this environment $ source .venv/bin/activate # upgrade pip (.venv) $ python3 -m pip install --upgrade pip # install tensorflow packages, note that the GPU version of tensorflow requires the installation of the CUDA toolkit, as well as other libraries such as cuDNN (CUDA Deep Neural Network library). (.venv) $ python3 -m pip install 'tensorflow[and-cuda]' # install keras (.venv) $ python3 -m pip install keras # install pytorch, note that the url needs to be specified to work with a specific version of CUDA, in this case 12.8 (.venv) $ python3 -m pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu128 |
Using Docker
If you want to use GPUs in docker, you need to take few extra steps after creating the VM.
...