I am using an input with size batchsize x nFeatures
.
The data loader is as follows:
train_loader = DataLoader(peakspectra_tic, batch_size=bSize, shuffle=True, num_workers=1, drop_last=False)
And the conv layer is:
def convlayer_(self, inchannels, outchannels, outputsize):
layer = nn.Sequential(
nn.Conv1d(in_channels=inchannels, out_channels=outchannels, kernel_size=3, stride=1, padding=1),
nn.BatchNorm1d(num_features=outputsize),
nn.ReLU()
)
return layer
When the batch size is equal to bSize
it runs but in the last batch(drop last) which is not equal it runs into error.
How to deal with this?