thank you so much for your reply .
I just want to print here the last erreur which I think it would be caused by something else
Traceback (most recent call last):
  File "./train.py", line 141, in <module>
    model.optimize_parameters()   # calculate loss functions, get gradients, update network weights
  File "/content/gdrive/My Drive/Colab Notebooks/STANet-withpth/models/CDFA_model.py", line 117, in optimize_parameters
    self.backward()                   # calculate graidents for G
  File "/content/gdrive/My Drive/Colab Notebooks/STANet-withpth/models/CDFA_model.py", line 107, in backward
    self.loss.backward()
  File "/usr/local/lib/python3.7/dist-packages/torch/tensor.py", line 245, in backward
    torch.autograd.backward(self, gradient, retain_graph, create_graph, inputs=inputs)
  File "/usr/local/lib/python3.7/dist-packages/torch/autograd/__init__.py", line 147, in backward
    allow_unreachable=True, accumulate_grad=True)  # allow_unreachable flag
RuntimeError: CUDA out of memory. Tried to allocate 2.00 GiB (GPU 0; 11.17 GiB total capacity; 9.06 GiB already allocated; 1.32 GiB free; 9.39 GiB reserved in total by PyTorch)