Hi, all.
I’m trying to built a Linear model with this parameters:
CONST_DE_NORMALIZACAO = 255.0
descritores = torch.Tensor([[247, 248, 244], [246, 245, 243],[194, 189, 186], [167, 159, 153],[142, 131, 123],[126, 114, 106], [102, 88, 79], [96, 82, 74],[89, 75, 66], [88, 74, 65]])
labels = [[0],[1],[2],[3],[4],[5],[6],[7],[8],[9]]
# Normalização
treino_x = descritores / CONST_DE_NORMALIZACAO
treino_y = Variable(torch.Tensor(labels))
class Model(torch.nn.Module):
def __init__(self):
super(Model, self).__init__()
self.linear = torch.nn.Linear(10, 1)
def forward(self, x):
y_predict = self.linear(x)
return y_predict
but, when I call this part of my code:
y_predito = modelo(treino_x)
I’m receiving this error message:
return torch.addmm(bias, input, weight.t())
RuntimeError: size mismatch, m1: [10 x 3], m2: [10 x 1] at …