The following is the whole error message when I dont use the retain_graph=True in .backward():

Blockquote C:\Users\I3ase\miniconda3\lib\site-packages\torch\autograd_init_.py:145: UserWarning: Error detected in ReluBackward0. Traceback of forward call that caused the error:
File “C:\Users\I3ase\miniconda3\lib\runpy.py”, line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File “C:\Users\I3ase\miniconda3\lib\runpy.py”, line 87, in run_code
exec(code, run_globals)
File "C:\Users\I3ase\miniconda3\lib\site-packages\spyder_kernels\console_main.py", line 23, in 
start.main()
File “C:\Users\I3ase\miniconda3\lib\site-packages\spyder_kernels\console\start.py”, line 296, in main
kernel.start()
File “C:\Users\I3ase\miniconda3\lib\site-packages\ipykernel\kernelapp.py”, line 612, in start
self.io_loop.start()
File “C:\Users\I3ase\miniconda3\lib\site-packages\tornado\platform\asyncio.py”, line 199, in start
self.asyncio_loop.run_forever()
File “C:\Users\I3ase\miniconda3\lib\asyncio\base_events.py”, line 596, in run_forever
self._run_once()
File “C:\Users\I3ase\miniconda3\lib\asyncio\base_events.py”, line 1890, in _run_once
handle._run()
File “C:\Users\I3ase\miniconda3\lib\asyncio\events.py”, line 80, in _run
self._context.run(self._callback, *self._args)
File “C:\Users\I3ase\miniconda3\lib\site-packages\tornado\ioloop.py”, line 688, in 
lambda f: self._run_callback(functools.partial(callback, future))
File “C:\Users\I3ase\miniconda3\lib\site-packages\tornado\ioloop.py”, line 741, in _run_callback
ret = callback()
File “C:\Users\I3ase\miniconda3\lib\site-packages\tornado\gen.py”, line 814, in inner
self.ctx_run(self.run)
File “C:\Users\I3ase\miniconda3\lib\site-packages\tornado\gen.py”, line 775, in run
yielded = self.gen.send(value)
File “C:\Users\I3ase\miniconda3\lib\site-packages\ipykernel\kernelbase.py”, line 365, in process_one
yield gen.maybe_future(dispatch(*args))
File “C:\Users\I3ase\miniconda3\lib\site-packages\tornado\gen.py”, line 234, in wrapper
yielded = ctx_run(next, result)
File “C:\Users\I3ase\miniconda3\lib\site-packages\ipykernel\kernelbase.py”, line 268, in dispatch_shell
yield gen.maybe_future(handler(stream, idents, msg))
File “C:\Users\I3ase\miniconda3\lib\site-packages\tornado\gen.py”, line 234, in wrapper
yielded = ctx_run(next, result)
File “C:\Users\I3ase\miniconda3\lib\site-packages\ipykernel\kernelbase.py”, line 543, in execute_request
self.do_execute(
File “C:\Users\I3ase\miniconda3\lib\site-packages\tornado\gen.py”, line 234, in wrapper
yielded = ctx_run(next, result)
File “C:\Users\I3ase\miniconda3\lib\site-packages\ipykernel\ipkernel.py”, line 306, in do_execute
res = shell.run_cell(code, store_history=store_history, silent=silent)
File “C:\Users\I3ase\miniconda3\lib\site-packages\ipykernel\zmqshell.py”, line 536, in run_cell
return super(ZMQInteractiveShell, self).run_cell(*args, **kwargs)
File “C:\Users\I3ase\miniconda3\lib\site-packages\IPython\core\interactiveshell.py”, line 2894, in run_cell
result = self._run_cell(
File “C:\Users\I3ase\miniconda3\lib\site-packages\IPython\core\interactiveshell.py”, line 2940, in _run_cell
return runner(coro)
File “C:\Users\I3ase\miniconda3\lib\site-packages\IPython\core\async_helpers.py”, line 68, in pseudo_sync_runner
coro.send(None)
File “C:\Users\I3ase\miniconda3\lib\site-packages\IPython\core\interactiveshell.py”, line 3165, in run_cell_async
has_raised = await self.run_ast_nodes(code_ast.body, cell_name,
File “C:\Users\I3ase\miniconda3\lib\site-packages\IPython\core\interactiveshell.py”, line 3357, in run_ast_nodes
if (await self.run_code(code, result,  async=asy)):
File “C:\Users\I3ase\miniconda3\lib\site-packages\IPython\core\interactiveshell.py”, line 3437, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File “”, line 1, in 
runfile(‘C:/Users/I3ase/Documents/projects/agcn/unit_test_sgc_ll.py’, wdir=‘C:/Users/I3ase/Documents/projects/agcn’)
File “C:\Users\I3ase\miniconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py”, line 565, in runfile
exec_code(file_code, filename, ns_globals, ns_locals,
File “C:\Users\I3ase\miniconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py”, line 453, in exec_code
exec(compiled, ns_globals, ns_locals)
File “C:\Users\I3ase\Documents\projects\agcn\unit_test_sgc_ll.py”, line 96, in 
logits, out_nodes, out_laplacians = gnn(graphs,laplacians)
File “C:\Users\I3ase\miniconda3\lib\site-packages\torch\nn\modules\module.py”, line 889, in _call_impl
result = self.forward(*input, **kwargs)
File “C:\Users\I3ase\Documents\projects\agcn\unit_test_sgc_ll.py”, line 24, in forward
graphs2, laplacians2 = self.layer2(graphs1, laplacians1)
File “C:\Users\I3ase\miniconda3\lib\site-packages\torch\nn\modules\module.py”, line 889, in _call_impl
result = self.forward(*input, **kwargs)
File “C:\Users\I3ase\Documents\projects\agcn\sgc_ll.py”, line 183, in forward
out_graphs = F.relu(res_graph + sc_graph)
File “C:\Users\I3ase\miniconda3\lib\site-packages\torch\nn\functional.py”, line 1206, in relu
result = torch.relu(input)
(Triggered internally at  …\torch\csrc\autograd\python_anomaly_mode.cpp:104.)
Variable._execution_engine.run_backward(
Traceback (most recent call last):

File “C:\Users\I3ase\Documents\projects\agcn\unit_test_sgc_ll.py”, line 106, in 
loss.backward()
File “C:\Users\I3ase\miniconda3\lib\site-packages\torch\tensor.py”, line 245, in backward
torch.autograd.backward(self, gradient, retain_graph, create_graph, inputs=inputs)
File “C:\Users\I3ase\miniconda3\lib\site-packages\torch\autograd_init_.py”, line 145, in backward
Variable._execution_engine.run_backward(
RuntimeError: Trying to backward through the graph a second time, but the saved intermediate results have already been freed. Specify retain_graph=True when calling .backward() or autograd.grad() the first time.
In addition, DGL uses a similar loop ChebNet 2