It then just says
ValueError: too many values to unpack (expected 2)
It then just says
ValueError: too many values to unpack (expected 2)
Iām sorry, I currently have no computer to test this but from your description this might work:
for e in range(epochs):
loss_values = []
for data in np.dstack((x_train, y_train)):
_x = data[0]
_y = data[1]
inps = Variable(torch.from_numpy(_x).to(torch.float())
outs = Variable(torch.from_numpy(_y).to(torch.float())
optm.zero_grad()
outputs = model.forward(inps)
loss = criterion(outputs, outs)
loss.backward()
optm.step()
scalar_loss = no.asscalar(loss.detach().cpu().numpy())
loss_values.append(scalar_loss)
print('epoch {}, loss {}'.format(e,np.mean(np.asarray(loss_values))