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

SOM_LM-SNNs.py example breaks when running on a GPU #458

Closed
ChatSam opened this issue Feb 17, 2021 · 1 comment
Closed

SOM_LM-SNNs.py example breaks when running on a GPU #458

ChatSam opened this issue Feb 17, 2021 · 1 comment

Comments

@ChatSam
Copy link

ChatSam commented Feb 17, 2021

Runtime Error

 File "SOM_LM-SNNs.py", line 362, in <module>
    spikes=spike_record, assignments=assignments, n_labels=n_classes
  File "/home/ubuntu/bindsnet_temp/bindsnet/bindsnet/evaluation/evaluation.py", line 125, in all_activity
    rates[:, i] = torch.sum(spikes[:, indices], 1) / n_assigns
RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu!

background info
python version - Python 3.6.12
pytorch version - torch 1.7.0

to reproduce the error, navigate to the examples/mnist folder, then run
python SOM_LM-SNNs.py --n_train 1000 --n_test 100 --gpu

@Hananel-Hazan
Copy link
Collaborator

Thanks for catching it!

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