aa-samad / conv_snn

Code for "Convolutional spiking neural networks (SNN) for spatio-temporal feature extraction" paper
GNU General Public License v3.0
121 stars 26 forks source link

NameError: name 'lr_scheduler' is not defined #11

Open meltingCat opened 3 years ago

meltingCat commented 3 years ago

Running the code in folder Tests_1-3_and_5. It seens that all the code had the same error below.

8192it [00:02, 3912.96it/s]                                                                                               
9920512it [00:19, 1117448.86it/s]                                                                                         Epoch [1/10], Step [100/600], Loss: nan
Time elasped: 11.564528942108154
                                                                                                                         Epoch [1/10], Step [200/600], Loss: nan
Time elasped: 22.981971263885498]                                                                                         
Epoch [1/10], Step [300/600], Loss: nan
Time elasped: 34.35000038146973
Epoch [1/10], Step [400/600], Loss: nan
Time elasped: 45.67948770523071
Epoch [1/10], Step [500/600], Loss: nan
Time elasped: 56.9581983089447
Epoch [1/10], Step [600/600], Loss: nan
Time elasped: 68.23811769485474
Traceback (most recent call last):
  File "main.py", line 94, in <module>
    optimizer = lr_scheduler(optimizer, epoch, learning_rate, 40)
NameError: name 'lr_scheduler' is not defined
9920512it [01:22, 120381.43it/s] 
1654784it [01:12, 22939.77it/s]  
wangxiao5791509 commented 3 years ago

@meltingCat from torch.optim import lr_scheduler