chan8972 / Enabling_Spikebased_Backpropagation

MIT License
32 stars 7 forks source link

Issues in training from scratch #1

Open godatta opened 4 years ago

godatta commented 4 years ago

Hi,

When I am trying to train from scratch, I get such an error :

"Traceback (most recent call last): File "cifar10_ResNet11.py", line 704, in main() File "cifar10_ResNet11.py", line 143, in main train(train_loader, model, criterion, criterion_en, optimizer, epoch, time_steps=100, leak=0.99) File "cifar10_ResNet11.py", line 206, in train output, Total_11_output, LF_11_output, Total_21_output, LF_21_output, Total_22_output, LF_22_output, Total_31_output, LF_31_output, Total_32_output, LF_32_output, Total_41_output, LF_41_output, Total_42_output, LF_42_output, Total_51_output, LF_51_output, Total_52_output, LF_52_output, Total_f0_output, LF_f0_output, out11_temp, out21_temp, out22_temp, out31_temp, out32_temp, out41_temp, out42_temp, out51_temp, out52_temp, outf0_temp = model(input_var, steps=time_steps, l=leak) File "/home/ubuntu/anaconda3/envs/pytorch_p27/lib/python2.7/site-packages/torch/nn/modules/module.py", line 532, in call result = self.forward(*input, **kwargs) File "cifar10_ResNet11.py", line 570, in forward mem_11, out = LIF_sNeuron(mem_11, self.cnn11.threshold, l, i) File "cifar10_ResNet11.py", line 411, in LIF_sNeuron out = SpikingNN()(ex_membrane) TypeError: forward() takes exactly 2 arguments (1 given)".

Can you please check from your side?

chan8972 commented 4 years ago

From my side, it works fine. Please check your python (should be 2.7) and PyTorch (should be 0.3.1) version.

Po0ria commented 2 years ago

@godatta Try using this instead: out = SpikingNN.apply(ex_membrane)