Skip to content
Snippets Groups Projects

Update tf version in Anaconda GPU example

Merged Natasha Pavlovikj requested to merge update_tf into master
1 file
+ 10
10
Compare changes
  • Side-by-side
  • Inline
@@ -218,19 +218,23 @@ If you just create custom GPU environment without cloning the module, your code
For example, if you want to use `tensorflow` with additional packages, first do:
{{% panel theme="info" header="Cloning GPU module to a new Anaconda environment" %}}
{{< highlight bash >}}
module load tensorflow-gpu/py39/2.9
module load tensorflow-gpu/py311/2.15
module load anaconda
conda create -n tensorflow-gpu-2.9-custom --clone $CONDA_DEFAULT_ENV
conda create -n tensorflow-gpu-2.15-custom --clone $CONDA_DEFAULT_ENV
module purge
{{< /highlight >}}
{{% /panel %}}
This will create a new `tensorflow-gpu-2.9-custom` environment in your home directory that is a copy of the `tensorflow-gpu` module.
{{% notice note %}}
While `tensorflow-gpu/py311/2.15` is used here as an example module and version, please make sure you use the newest available version of the module you want to clone, or the version that is needed for your particular research needs.
{{% /notice %}}
This will create a new `tensorflow-gpu-2.15-custom` environment in your home directory that is a copy of the `tensorflow-gpu` module.
Then, you can install the additional packages you need in this environment.
{{% panel theme="info" header="Install new packages in the currently active environment" %}}
{{< highlight bash >}}
module load anaconda
conda activate tensorflow-gpu-2.9-custom
conda activate tensorflow-gpu-2.15-custom
conda install <packages>
{{< /highlight >}}
{{% /panel %}}
@@ -238,16 +242,12 @@ conda install <packages>
Next, whenever you want to use this custom GPU Anaconda environment, you need to add these two lines in your submit script:
{{< highlight bash >}}
module load anaconda
conda activate tensorflow-gpu-2.9-custom
conda activate tensorflow-gpu-2.15-custom
{{< /highlight >}}
{{% notice info %}}
If you have custom GPU Anaconda environment please only use the two lines from above and **DO NOT** load the module you have cloned earlier.
Using `module load tensorflow-gpu/py39/2.9` and `conda activate tensorflow-gpu-2.9-custom` in the same script is **wrong** and may give you various errors and incorrect results.
{{% /notice %}}
{{% notice note %}}
While `tensorflow-gpu/py39/2.9` is used here as an example module and version, please make sure you use the newest available version of the module you want to clone, or the version that is needed for your particular research needs.
Using `module load tensorflow-gpu/py311/2.15` and `conda activate tensorflow-gpu-2.15-custom` in the same script is **wrong** and may give you various errors and incorrect results.
{{% /notice %}}
### Creating Custom MPI Anaconda Environment
Loading