SpecAugment icon indicating copy to clipboard operation
SpecAugment copied to clipboard

How to Perform Spec Augmentation on Batch Size > 1?

Open shawnbzhang opened this issue 4 years ago • 1 comments

For example, I have a tensor with a batch size of 2, e.g. of shape torch.Size([2, 256, 512]). Now, when I run the command through

spec_augment_pytorch.spec_augment(mel_spectrogram=mel_spectrogram)

I have the error

RuntimeError: shape '[2, 256, 512, 2]' is invalid for input of size 262144

I don't think the source code accomodates batches, despite the input dimensions.

shawnbzhang avatar Nov 25 '20 03:11 shawnbzhang

https://github.com/IMLHF/SpecAugmentPyTorch, this support batch and channel, and fix time wrap bugs by using torch functions

IMLHF avatar Dec 31 '21 10:12 IMLHF