Tensorflow
Installed versions
| Resource | Version |
|---|---|
| Dardel/cpe23.12 | 2.13 |
General information
TensorFlowâ„¢ is an open source software library for machine learning, deep learning and other numerical computations using data flow graphs. For more information see the TensorFlow homepage.
How to use
Tensorflow 2.13 is available as a singularity container at PDC.
In order to run the Tensorflow container, first allocate a GPU node. Then, load the PDC and the singularity modules.
ml add PDC
ml add singularity/4.2.0-cpeGNU-24.11
ls $PDC_SHUB
singularity shell --rocm -B /cfs/klemming /pdc/software/resources/sing_hub/rocm5.7-tf2.13-dev
Singularity>
singularity exec --rocm -B /cfs/klemming /pdc/software/resources/sing_hub/rocm5.7-tf2.13-dev python3 <TF_script.py>
Installing additional Python packages
There are some restrictions regarding singularity on Dardel. Users cannot write into singularity containers, and therefore, users cannot install additional python packages directly into the container.
So if you need additional python packages, you can add them via one of these two following methods:
- Download the Tensorflow singularity container to your local machine where you have a local installation of singularity. Then, update the image there installing the packages needed, and afterwards upload the image to Dardel again.
- Install the additional python packages directly on Dardel, but outside the singularity container. For example, in your home directory (the default behaviour with pip), or in your project directory using the --target flag with the pip command. Remember that if you install additional python packages outside the default python directories, you need to update the PYTHONPATH variable with the path where those new packages are before you run the container. In this case, the command for launching the shell or running the script directly with the additional packages recognized can be modified as follows:
singularity exec --env PYTHONPATH=<.......>:$PYTHONPATH --rocm -B /cfs/klemming /pdc/software/resources/sing_hub/rocm5.7-tf2.13-dev python3 <TF_script.py>
When installing new packages it is advisable to add the condition numpy==1.22.4 to pip install in order to prevent pip from upgrading the version of numpy in the container, which would cause compatibility problems. Example:
pip install matplotlib numpy==1.22.4