Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
lelucermaireme opened this issue Jul 16, 2024 · 3 comments
Open

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

lelucermaireme opened this issue Jul 16, 2024 · 3 comments

Comments

@lelucermaireme
Copy link

  • 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
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
Copy link
Owner

jeshraghian commented Jul 16, 2024 via email

@lelucermaireme
Copy link
Author

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.

@lelucermaireme
Copy link
Author

I think the mistake comes from the variable self.reset that defined in class Leaky. The variable self.reset is defined when an object of class Leaky is defined. So the variable self.reset is on a fixed GPU. But the inputs to the network are on different GPUs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants