Closed kt-13 closed 2 months ago
I got the same issue here! I think it is a library bug My solution is to downgrade it to 0.8.0.
Apparently, this issue has come up before (#225) and a workaround was described there, but I was able to temporarily fix it by downgrading to version 0.8.1
.
pip install snntorch==0.8.1
I will take a look at this, in the meanwhile you can also fix this with.
torch.set_default_device("cuda")
I still find this error when running the training loop without population coding in Advanced Tutorials: Population Coding. Setting default device to cuda did not work, but downgrading to 0.8.1 did the job. I guess it's because of the deprecation of snntorch.backprop module.
Have you tried installing snntorch from the source rather than pip?
I am trying to do it in Colab now. However another error comes out, ModuleNotFoundError: No module named 'nir'
, even though the module was there when I checked with !pip show
. Does the setup.py in snnTorch only installing the module locally in the snnTorch folder path? Sorry for asking out of topic, some help will be much appreciated!
Ah I run into the same error, but it fixed when I restarted my run time... in any case, I'll update the pypi today or tomorrow. That'll hopefully fix everything.
I am finally able to run both of the tutorial in Colab by installing and importing nir and nirtorch first before installing snntorch from the source. Nevertheless, updating the pypi will be a great help. Thank you!
Description
I get an error telling me that all tensors must be on the same device when I try to create a new model on a GPU. Below is the code I am using. It seems to be a similar issue to the one here https://github.com/jeshraghian/snntorch/issues/225. If you manually set the device for each leaky object, like I did in the commented out lines, it fixes the issue.
What I Did