alantanlc / torchemotion

Emotion recognition library for PyTorch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue with size mismatch while passing spectrogram features

mshivasharan opened this issue · comments

Hello, Instead of passing waveform as input to the model, I am trying to pass spectrogram features as input to the model but I am getting an error saying size mismatch. Could you please help me in fixing the issue? This is the code I am trying.

for inputs, emotions, n_frames in dataloaders[phase]:
specgram = specgram_transform(inputs.view(1, -1))
specgram = specgram.to(device)
emotions = emotions.long().to(device)
optimizer.zero_grad()

# forward
# track history if only in train
with torch.set_grad_enabled(phase == 'train'):
    outputs = model(specgram)