Create a conda environment
- If not already installed, download and install conda (anaconda)
- If not done, finalize conda installation and configuration (adjust the string of PATH_TO_CONDA)
$ source PATH_TO_CONDA/anaconda3/bin/activate
$ conda init
- Download TF2.10-cuda.yml (older version : TF2.6-cuda.yml )
- Create the conda environment with the yml file you want (this example will create it in /tmp)
- $
conda env create --prefix /tmp/${USER}/conda_TF2.10-cuda -f TF2.10-cuda.yml
- $
- Activate the environment $
conda activate /tmp/${USER}/conda_TF2.6-cuda
- You can now enjoy your virtual environment ! (The previous .yml file is for linux without the bug of the ‘Cannot register 2 metrics with the same name: /tensorflow/api/keras/optimizers’ that is linked with a keras/tensorflow versions (2.7 vs 2.6); For windows, remove the cupti package)
- When you want to stop, you can deactivate an environment to restore initial one (base) :
$ conda deactivate
A short summary of conda utilization:
This procedure is the same for PyTorch, just download pytorch1.12-cuda.yml and adapt the previous lines.
$ conda env create --prefix /tmp/${USER}/pytorch1.12-cuda -f
pytorch1.12-cuda
.yml