-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to feed model batch inputs ? #21
Comments
+1 |
hi bros, I feed model batch inputs through the following steps.
class FintuneModel(nn.Module):
def __init__(self):
super(FintuneModel, self).__init__()
urls = {
'vggish': "https://github.com/harritaylor/torchvggish/releases/download/v0.1/vggish-10086976.pth"
}
self.pretrain = vggish.VGGish(urls, preprocess=False, postprocess=False)
self.classifier = classifier()
def forward(self, x):
"""
:param x: [bs, num_frames, 96, 64]
:return:
"""
bs, num_frames, _, _ = x.size()
x = x.view(bs*num_frames, 1, x.size(2), x.size(3))
x = self.pretrain(x) # [bs*num_frames, 128]
x = x.view(bs, x.size(1), num_frames)
x = self.classifier(x)
return x |
@Chevalier1024 so each batch has a different number of samples? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hi, how can i feed the model batch inputs ? i just know how to feed one audio to the model,but if i want to feed batch?can you tell me ? thanks.
The text was updated successfully, but these errors were encountered: