[solved] Convert tensors into sequences vs tuples issue?

I think I have a simple error, but not sure how to fix it. How do I convert this into a sequence ? Im not sure what kind of type this is

I construct my own tensor like so:

        mini_ts = torch.IntTensor(128,3,40,40)
        for ii,image in enumerate(images):
            mini_ts[ii] = mini_transform(image)
        mini_ts = to_var(mini_ts.view(128,-1),volatile=True)
        print(mini_ts.size())

Here is the error I get:

TypeError: cat received an invalid combination of arguments - got (tuple, int), but expected one of:

  • (sequence[torch.cuda.IntTensor] seq)
  • (sequence[torch.cuda.IntTensor] seq, int dim)
    didn’t match because some of the arguments have invalid types: (tuple, int)

Can anyone help me with this? I think I didn’t explain it with enough information. I am playing with image captioning here: https://github.com/yunjey/pytorch-tutorial/blob/master/tutorials/03-advanced/image_captioning/
I am trying to see what the results of replacing this line which takes the features from a cnn and instead replace it with a tensor of images that is the same size that are just resized images: https://github.com/yunjey/pytorch-tutorial/blob/master/tutorials/03-advanced/image_captioning/train.py#L69

min_transform is just:

mini_transform = transforms.Compose([
    transforms.Scale(40),
    transforms.ToTensor() ])

the tensor of encoder(images) and mini_transform(images) are the same size, but when I pass mini_ts into decoder(mini_ts,captions,lengths) I get the error about types are not the same. I think it is because I build mini_ts with a for loop. Why am I getting this error and how can I fix it?

fixed, my silly mistake

what was the error? I am stuck!

Thanks. :slight_smile:

Got the error… It was an indeed silly mistake.