Search code examples
torch

bad argument #2 to ?(expecting number or torch.DoubleTensor or torch.DoubleStorage at Tensor.c:1125)


The code i used is:

  local word2vec=nn.LookupTable(sent_len,300)

then got the error:bad argument2 # to ?(expecting number or torch.DoubleTensor or torch.DoubleStorage at Tensor.c:1125)

Solution

  • after many times trial, I finally find is the reason of type of sent_len, It should be a number type but it is not in my codes.