SNN相关问题
问题:在传统ANN模型中直接修改,加入neuron.IFnode层后报错,
RuntimeError: Trying to backward through the graph a second time (or directly access saved tensors after they have already been freed). Saved intermediate values of the graph are freed when you call .backward() or autograd.grad(). Specify retain_graph=True if you need to backward through the graph a second time or if you need to access saved tensors after calling backward.
解决:忘记在训练过程中添加
functional.reset_net(model)