Hi, I am making Chatbot Tutorial — PyTorch Tutorials 1.9.1+cu102 documentation This Pytorch tutorial
If loadFilename= None its working but
I am training , loadFilename = “4000_checkpoint.tar” it says
Traceback (most recent call last):
  File "torch_chatbot.py", line 617, in <module>
    print_every, save_every, clip, corpus_name, loadFilename)
  File "torch_chatbot.py", line 438, in trainIters
    for _ in range(n_iteration)]
  File "torch_chatbot.py", line 438, in <listcomp>
    for _ in range(n_iteration)]
  File "torch_chatbot.py", line 232, in batch2TrainData
    inp, lengths = inputVar(input_batch, voc)
  File "torch_chatbot.py", line 209, in inputVar
    indexes_batch = [indexesFromSentence(voc, sentence) for sentence in l]
  File "torch_chatbot.py", line 209, in <listcomp>
    indexes_batch = [indexesFromSentence(voc, sentence) for sentence in l]
  File "torch_chatbot.py", line 190, in indexesFromSentence
    return [voc.word2index[word] for word in sentence.split(' ')] + [EOS_token]
  File "torch_chatbot.py", line 190, in <listcomp>
    return [voc.word2index[word] for word in sentence.split(' ')] + [EOS_token]
KeyError: 'can'

I need help please