Skip to content

Evaluation Error : RuntimeError: rnn: hx is not contiguous #4

@LinuxBeginner

Description

@LinuxBeginner

Training was successful. Data:
vatex_training_v1.0.json
vatex_validation_v1.0.json
vatex_public_test_english_v1.1.json

System: Google Colab GPU

When I tried to run the python eval.py , it is showing the following error

Vocab size src/tgt:10523/2907
train/val/test size: 254/30/59
************ Start eval... ************
Use epoch 34 as the best model for testing
Traceback (most recent call last):
File "eval.py", line 123, in
main(args)
File "eval.py", line 63, in main
eval(test_loader, encoder, decoder, cp_file, tok_tgt, result_path)
File "eval.py", line 90, in eval
preds, pred_lengths = decoder.beam_decoding(srccap, init_hidden, src_out, vid_out, args.MAX_INPUT_LENGTH, beam_size=5)
File "/content/drive/My Drive/MMT/MMTvatex/Video-guided-Machine-Translation/model.py", line 208, in beam_decoding
output, hidden_i, attn_weights = self.onestep(output, hidden_i, src_out_i, vid_out_i, src_mask_i)
File "/content/drive/My Drive/MMT/MMTvatex/Video-guided-Machine-Translation/model.py", line 110, in onestep
output, hidden = self.decoder(rnn_input, last_hidden)
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 550, in call
result = self.forward(*input, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/rnn.py", line 570, in forward
self.dropout, self.training, self.bidirectional, self.batch_first)
RuntimeError: rnn: hx is not contiguous

Could you please tell me why is this happening?
Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions