jeshraghian / snntorch

Deep and online learning with spiking neural networks in Python
https://snntorch.readthedocs.io/en/latest/
MIT License
1.27k stars 214 forks source link

AttributeError: 'Leaky' object has no attribute 'reset' #339

Open lelucermaireme opened 2 months ago

lelucermaireme commented 2 months ago

Description

I used two GPUs to run my code and run into this error image But the code can be run with no error if I use one GPU. The error comes from the two devices, The tensors are run on different devices.

jeshraghian commented 2 months ago

Share a minimal working example of your code.

On Tue, 16 July 2024, 6:11 am Tracy, @.***> wrote:

  • snntorch version: 0.8.0
  • Python version: 3.7
  • Operating System: Linux

Description

I used two GPUs to run my code and run into this error image.png (view on web) https://github.com/user-attachments/assets/f046aa0c-7dba-4d7d-be15-db8931f23244 But the code can be run with no error if I use one GPU. The error comes from the two devices, The tensors are run on different devices.

— Reply to this email directly, view it on GitHub https://github.com/jeshraghian/snntorch/issues/339, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJTFT4SPTAHUUISJJT6LZVTZMUEYRAVCNFSM6AAAAABK6ORZVSVHI2DSMVQWIX3LMV43ASLTON2WKOZSGQYTAOJYGIYDONA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

lelucermaireme commented 2 months ago

Take the tutorial 5(https://snntorch.readthedocs.io/en/latest/tutorials/tutorial_5.html) as an example, I just add

os.environ["CUDA_VISIBLE_DEVICES"] = "0,1"
net = Net()
net = nn.DataParallel(net).cuda()

to make it work on multiple GPUs.