Hello Bram,
Thank you for having a look into my code. I agree with you, setting the seed should ensure the reproducibility of experiments. However, if I restart my Google Colab notebook and I rerun everything again, I get different results. May it be that cuda sessions have some randomness? Maybe one of these two chunks of code is adding such randomness:
This:
import tensorflow as tf

# Get the GPU device name.

device_name = tf.test.gpu_device_name()

# The device name should look like the following:

if device_name == '/device:GPU:0':

    print('Found GPU at: {}'.format(device_name))

else:

    raise SystemError('GPU device not found')

Or this:
import torch

# If there's a GPU available...

if torch.cuda.is_available():    

    # Tell PyTorch to use the GPU.    

    device = torch.device("cuda")

    print('There are %d GPU(s) available.' % torch.cuda.device_count())

    print('We will use the GPU:', torch.cuda.get_device_name(0))

# If not...

else:

    print('No GPU available, using the CPU instead.')

    device = torch.device("cpu")

May it be that virtual machines get assigned to different GPUs with different characteristics? This may explain the differences in results when I restart everything from scratch. I will carry some experiments where I put this part of the code in the loop. I’ll report here the results.
Thanks for your time and attention,
J.
[Update] Just tested by running everything again. I do get different results as when I restart & rerun again the whole Google Colab’s notebook.