Error in resuming training for OpenNMT model

(Leena Shekhar) #1

I set the flags -start_epoch to 13 ( as my last model was trained till epoch 12) and -train_from to point to my latest .pt file.

Error log:

Traceback (most recent call last):
File “”, line 406, in
File “”, line 402, in main
train_model(model, fields, optim, data_type, model_opt)
File “”, line 219, in train_model
train_stats = trainer.train(train_iter, epoch, report_func)
File “/gpfs/home/lshekhar/OpenNMT-py-master/onmt/”, line 199, in train
for i, batch_ in enumerate(train_iter):
File “”, line 129, in iter
for batch in self.cur_iter:
File “/gpfs/home/lshekhar/tools/torch/lib/python2.7/site-packages/torchtext/data/”, line 180, in iter
File “/gpfs/home/lshekhar/tools/torch/lib/python2.7/site-packages/torchtext/data/”, line 21, in init
batch = [x.dict[name] for x in data]
KeyError: ‘alignment’

(Leena Shekhar) #2

I guess my issue is related to the one mentioned here: I updated the code and started the training