BYU

Office of Research Computing

TensorFlow

TensorFlow Logo

Setup Mamba/Conda Environment

Setup and activate a new Mamba environment as outlined in the Python Documentation. After activating your mamba environment, install the necessary packages using the following commands:

mamba install -c nvidia -c conda-forge tensorflow-gpu

To use a specific Cuda version, you can run:

mamba install -c nvidia -c conda-forge tensorflow-gpu cudatoolkit=X.Y.Z

If you want to use tensorflow cpu-only, you can run:

mamba install -c nvidia -c conda-forge tensorflow

Job Script Specifications

  • To use a Conda environment inside of a Slurm job script, modify the first line so it looks like this:
#!/bin/bash --login
  • If your script is setup to utilize GPU's, request a GPU in your script:
#SBATCH --gpus=1 # NUMBER OF GPU'S
  • Load Mamba Environment At The Bottom Of The Job Script:
# # LOAD MODULES, INSERT CODE, AND RUN YOUR PROGRAMS HERE
mamba activate <EnvironmentName>
# # RUN ANY SCRIPTS, CODE, OR PROGRAMS THAT RELY ON THE MAMBA ENVIRONMENT HERE