Thank you for the answer, well the problem isn’t with the self.lstm(packed). Problem lies there during concatenation. I mean the following line of code is returning error.
embeddings = torch.cat((features.unsqueeze(1), embeddings), 1)

where as I mentioned, the features.unsqueeze(1) size is [5, 1, 15000] and embeddings size is [5, 14, 256] . The problem is I want to concatenate them so that I can pass them to the pack_padded_sequence, followed by lstm layer.
Do you understand what I am trying to convey?
To be more specific, I’m copying the error as below:
***********************************************************
Features loaded..!
epoch 0, of 4
lengths shape = torch.Size([5]) and targets shape = torch.Size([5, 14])
features shape = torch.Size([5, 15000]), captions shape: torch.Size([5, 14]), lengths = torch.Size([5])
features size: torch.Size([5, 1, 15000]), embeddings: torch.Size([5, 14, 256])
Traceback (most recent call last):
  File "Training.py", line 94, in <module>
    main()
  File "Training.py", line 73, in main
    outputs = decoder(features, captions, lengths)
  File "C:\Users\user02\anaconda3\envs\videocaptioning\lib\site-packages\torch\nn\modules\module.py", line 727, in _call_impl
    result = self.forward(*input, **kwargs)
  File "C:\Users\user02\Documents\GitHub\ExplainedMVS\BaselineImageCaptioningTorch\BaseNetwork.py", line 48, in forward
    embeddings = torch.cat((features.unsqueeze(1), embeddings), 1)
RuntimeError: Sizes of tensors must match except in dimension 2. Got 256 and 15000 (The offending index is 0)