fangwei123456 / spikingjelly

SpikingJelly is an open-source deep learning framework for Spiking Neural Network (SNN) based on PyTorch.
https://spikingjelly.readthedocs.io
Other
1.35k stars 239 forks source link

About DVS-Gesture dataset #71

Closed lslynf closed 3 years ago

lslynf commented 3 years ago

The input of the dataset is (128128), how to change the input size to (32 32)? Thanks a lot!

fangwei123456 commented 3 years ago
from spikingjelly.datasets import dvs128_gesture
import torch.nn.functional as F
import torch
train_set = dvs128_gesture.DVS128Gesture('D:/datasets/DVS128Gesture', train=True, data_type='frame', frames_number=16, split_by='number')
x, y = train_set[0]
print(x.shape)

x = torch.from_numpy(x).float()

print(F.interpolate(x, size=(32, 32)).shape)
mountains-high commented 3 years ago
from spikingjelly.datasets import dvs128_gesture
import torch.nn.functional as F
import torch
train_set = dvs128_gesture.DVS128Gesture('D:/datasets/DVS128Gesture', train=True, data_type='frame', frames_number=16, split_by='number')
x, y = train_set[0]
print(x.shape)

x = torch.from_numpy(x).float()

print(F.interpolate(x, size=(32, 32)).shape)

Good day, I used(run) the above code lines, but I am getting this error:

  '"sox" backend is being deprecated. '
Traceback (most recent call last):
  File "set.py", line 4, in <module>
    train_set = dvs128_gesture.DVS128Gesture('.', train=True, data_type='frame', frames_number=16, split_by='number')
TypeError: __init__() got an unexpected keyword argument 'data_type' 

Could you help me to solve this problem, please? Thank you

fangwei123456 commented 3 years ago

Do you use an old version (e.g., from pypi)? Some datasets API have been changed after 0.0.0.4. You can try to install from the source codes in GitHub.