To make your script robust enough for the environment of OmniOpt on Taurus, it is recommeded that you do not run your script directly in the objective program string. Rather, it is recommeded that you create a from which your program gets run.

It may look like this:

#!/bin/bash -l
# ^ Shebang-Line, so that it is known that this is a bash file
# -l means 'load this as login shell', so that /etc/profile gets loaded and you can use 'module load' or 'ml' as usual

# If you use this script not via `./' or just `srun', but like `srun bash', please add the '-l' there too.
# Like this:
# srun bash -l

# Load modules your program needs, always specify versions!
ml TensorFlow/2.3.1-fosscuda-2019b-Python-3.7.4 # Or whatever modules you need

# Load specific virtual environment (if applicable)
source /path/to/environment/bin/activate

# Load your script. $@ is all the parameters that are given to this file.
python3 /absolute/path/ $@

Even though sbatch may inherit shell variables like loaded modules, it is not recommended to rely on that heavily, because, especially when copying the curl-command from this website, you may forget loading the correct modules. This makes your script much more robust to changes.

Also, always load specific module-versions and never let lmod guess the versions you want. Once these change, you'll almost certainly have problems otherwise.