Running examples/models/agi/model.py crashes in AudioEncoder.forward with a Conv1d channel mismatch:
RuntimeError: Given groups=1, weight of size [64, 40, 3], expected input[1, 81, 40] to have 40 channels, but got 81 channels instead
In AudioEncoder.forward the MFCC output is transposed right before the conv stack (around line 139-143):
mfcc = self.mfcc_transform(x) # (batch_size, n_mfcc=40, time)
mfcc = mfcc.transpose(1, 2) # (batch_size, time, n_mfcc) <-- moves the channel dim away
out = self.conv(mfcc) # nn.Conv1d(40, 64, ...) expects 40 channels in dim 1
nn.Conv1d(40, 64, ...) expects the channel dim (n_mfcc = 40) in position 1, but the transpose(1, 2) puts time (81 here) there instead, so the conv sees 81 "channels". The transpose contradicts the comment on the conv input. Dropping that line keeps MFCC as (batch, 40, time) and the conv runs:
mfcc = self.mfcc_transform(x) # (batch_size, n_mfcc, time)
out = self.conv(mfcc)
Note there are additional unrelated errors further down the demo (an einsum dimension mismatch in the mixture-of-experts gating), but the AudioEncoder transpose is the first and a clear one.
Running
examples/models/agi/model.pycrashes inAudioEncoder.forwardwith a Conv1d channel mismatch:In
AudioEncoder.forwardthe MFCC output is transposed right before the conv stack (around line 139-143):nn.Conv1d(40, 64, ...)expects the channel dim (n_mfcc = 40) in position 1, but thetranspose(1, 2)putstime(81 here) there instead, so the conv sees 81 "channels". The transpose contradicts the comment on the conv input. Dropping that line keeps MFCC as(batch, 40, time)and the conv runs:Note there are additional unrelated errors further down the demo (an einsum dimension mismatch in the mixture-of-experts gating), but the
AudioEncodertranspose is the first and a clear one.