Relative Content

Tag Archive for jupyter-notebookpytorchgoogle-colaboratorypytorch-geometric

Trying to understand why I have RuntimeError on Mac in backward method in pytorch but same code works fine in Google Colab

Work with tutorial on temporal graphs. When I execute the code in Google Colab everything works fine without any error, but when I run same notebook on laptops (Macbook Air 2020 and Macbook Pro 2019) I meet the exception – RuntimeError: Trying to backward through the graph a second time (or directly access saved tensors after they have already been freed).
The error appears in training part during call of loss.backward() in first iteration of both loops.
It seems to me quite strange because I use almost the same versions of pytorch 2.4.0 on laptop and 2.4.0+cu121 in Google Colab.