If you do not specify Keras backend, then TensorFlow is used as a
default
If you do not specify Keras backend, then TensorFlow is used as a default
Job-file (schedule job with sbatch, check the status with 'squeue -u
\<Username>'):
Job-file (schedule job with sbatch, check the status with 'squeue -u \<Username>'):
#!/bin/bash<br />#SBATCH --gres=gpu:1 # 1 - using one gpu, 2 - for using 2 gpus<br />#SBATCH --mem=8000<br />#SBATCH -p gpu2 # select the type of nodes (opitions: haswell, <code>smp</code>, <code>sandy</code>, <code>west</code>, <code>gpu, ml) </code><b>K80</b> GPUs on Haswell node<br />#SBATCH --time=00:30:00<br />#SBATCH -o HLR_<name_of_your_script>.out # save output under HLR_${SLURMJOBID}.out<br />#SBATCH -e HLR_<name_of_your_script>.err # save error messages under HLR_${SLURMJOBID}.err<br />
module purge # purge if you already have modules loaded<br />module load modenv/scs5 # load scs5 environment<br />module load Keras # load Keras module<br />module load TensorFlow # load TensorFlow module<br />
```Bash
#!/bin/bash
#SBATCH --gres=gpu:1 # 1 - using one gpu, 2 - for using 2 gpus
#SBATCH --mem=8000
#SBATCH -p gpu2 # select the type of nodes (opitions: haswell, smp, sandy, west,gpu, ml) K80 GPUs on Haswell node
#SBATCH --time=00:30:00
#SBATCH -o HLR_<name_of_your_script>.out # save output under HLR_${SLURMJOBID}.out
#SBATCH -e HLR_<name_of_your_script>.err # save error messages under HLR_${SLURMJOBID}.err
# if you see 'broken pipe error's (might happen in interactive session after the second srun command) uncomment line below<br /># module load h5py<br /><br />python mnist_cnn.py
module purge # purge if you already have modules loaded
module load modenv/scs5 # load scs5 environment
module load Keras # load Keras module
module load TensorFlow # load TensorFlow module
Keep in mind that you need to put the bash script to the same folder as
an executable file or specify the path.
# if you see 'broken pipe error's (might happen in interactive session after the second srun
command) uncomment line below
# module load h5py
python mnist_cnn.py
```
Keep in mind that you need to put the bash script to the same folder as an executable file or
specify the path.
Example output:
x_train shape: (60000, 28, 28, 1)
60000 train samples
10000 test samples
Train on 60000 samples, validate on 10000 samples
Epoch 1/12
```Bash
x_train shape: (60000, 28, 28, 1) 60000 train samples 10000 test samples Train on 60000 samples,