AiHaiHai
AiHaiHai
您好!我现在遇到了一个问题,当我自定义的神经元不继承 MemoryModule类,直接继承nn.Module时,在运行下述代码时  总是出现 错误: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...
> @AiHaiHai在第n次训练时,需要对神经元进行重置,清除给n-1次的状态。 > > https://github.com/fangwei123456/spikingjelly/blob/01e285fe907c22ee310449663c5e7ae24f41fce8/spikingjelly/clock_driven/functional.py#L7 > > https://github.com/fangwei123456/spikingjelly/blob/01e285fe907c22ee310449663c5e7ae24f41fce8/spikingjelly/clock_driven/examples/lif_fc_mnist.py#L138 我试了一下,的确实没问题了,非常感谢。这里主要调用了该base类, https://github.com/fangwei123456/spikingjelly/blob/01e285fe907c22ee310449663c5e7ae24f41fce8/spikingjelly/clock_driven/base.py#L54 amazing,这里您说的,清除状态是清除什么状态呢,优化器step后对整个网络reset,具体是执行了什么操作,为什么调用该类就可以正常运行,不执行就会报错呢?