RuntimeError Traceback (most recent call last)
in
76 if torch.cuda.is_available():
77 model.cuda()
---> 78 train(model, train_X, train_Y, batch_size, n_epochs)
79 print('----Test result---')
80 test(model, test_X, test_Y)
in train(model, X, Y, batch_size, n_epochs)
40 print (type(probs))
41 outputs = probs.view(-1, L) # (bsM, L)
---> 42 y = y.view(-1) # (bsM)
43 loss = F.nll_loss(outputs, y)
44
RuntimeError: view size is not compatible with input tensor's size and stride (at least one dimension spans across two contiguous subspaces). Use .reshape(...) instead.
RuntimeError Traceback (most recent call last)
in
76 if torch.cuda.is_available():
77 model.cuda()
---> 78 train(model, train_X, train_Y, batch_size, n_epochs)
79 print('----Test result---')
80 test(model, test_X, test_Y)
in train(model, X, Y, batch_size, n_epochs)
40 print (type(probs))
41 outputs = probs.view(-1, L) # (bsM, L)
---> 42 y = y.view(-1) # (bsM)
43 loss = F.nll_loss(outputs, y)
44
RuntimeError: view size is not compatible with input tensor's size and stride (at least one dimension spans across two contiguous subspaces). Use .reshape(...) instead.