You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a very common error when making a batch:
RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension 0. Got 1 and 2 in dimension 1
and is a result of doing one of the following 4 things.
mixing mono and stereo or...
different sample rates or...
you forgot to crop to same width or...
you cropped to same width but did a transform after that altered width somehow
It would be very nice if we added warnings to alert users to presence of multiple sample rates (Resample required) or varying # of channels (downmix required), or neither (crop required).
The text was updated successfully, but these errors were encountered:
I recently faced 1 and 2 and eventually solved 1 by writing a custom method and 2 by using a custom sox hack. I didn't know about DownminToMono and Resample before.
I think the way I traced the error is a good fix to the above situation. I can write a method verify_pipeline() that takes the pipeline of transformations or tfms in-general, loop through transform and tells where exactly the problem lies.
If this approach makes sense to you then please give me a thumbs-up and I'll write, test and send a PR.
That could be interesting, I was thinking of writing a verify pipeline for another features that we're still missing from the previous version. I think that this may be useful so please feel free to open PR and we can continue the discussion there. Thanks again for your help!
This is a very common error when making a batch:
RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension 0. Got 1 and 2 in dimension 1
and is a result of doing one of the following 4 things.
It would be very nice if we added warnings to alert users to presence of multiple sample rates (Resample required) or varying # of channels (downmix required), or neither (crop required).
The text was updated successfully, but these errors were encountered: