good day your support this error RuntimeError: mat1 dim 1 must match mat2 dim 0, I am working pytorch to classify wav audios,
BATCH_SIZE = 32 ###128 para 4conv
EPOCHS = 10
LEARNING_RATE = 0.001
ANNOTATIONS_FILE = “…/data_aymara/metadata/aymara_sound.csv”
AUDIO_DIR = “…/data_aymara/audio”
SAMPLE_RATE = 22050
NUM_SAMPLES = 22050
from torch import nn
from torchsummary import summary
class CNNNetwork(nn.Module):
def __init__(self):
super().__init__()
self.conv1 = nn.Sequential(
nn.Conv2d(
in_channels=1,
out_channels=16,
kernel_size=3,
stride=1,
padding=2
),
nn.ReLU(),
nn.MaxPool2d(kernel_size=2)
)
self.conv2 = nn.Sequential(
nn.Conv2d(
in_channels=16,
out_channels=32,
kernel_size=3,
stride=1,
padding=2
),
nn.ReLU(),
nn.MaxPool2d(kernel_size=2)
)
self.flatten = nn.Flatten()
self.linear = nn.Linear(32 * 3 * 4, 3)####2 convoluciones ####3 son las clases de salida, 32 capas ocultas
self.softmax = nn.Softmax(dim=1)
def forward(self, input_data):
x = self.conv1(input_data)
x = self.conv2(x)
x = self.flatten(x)
logits = self.linear(x)
predictions = self.softmax(logits)
return predictions