-
Notifications
You must be signed in to change notification settings - Fork 495
Translate Error #65
Comments
sorry, I made a naive mistake. |
What was the mistake? Did you figure it out? |
Hi, Traceback (most recent call last): |
This means that you are trying to reload a component that requires to have an output layer, when the reloaded model does not have any output layer. Can you try to set |
Hi, I will paste the full error :Traceback (most recent call last): |
I try to change line 80 in translate.py to if all([k.startswith('module.') for k in reloaded['encoder'].keys()]): And now , I get , again, shorter error ; |
Indeed, the problem is that you are trying to reload a checkpoint I think (because the Did you also set |
Now it works , Thanks !!! |
I meet the same problem with you. I use the pretrained model and then get the same error. Would you tell me your solution? |
hello,thanks for your code,
I run the train.sh as you writed in README, the command is:
and then,I want to use the saved model(The program has not finished running,the model is saved during the running of the program) to translate some sentences, the command is:
some error appears:
INFO - 04/25/19 10:48:43 - 0:00:00 - ============ Initialized logger ============
INFO - 04/25/19 10:48:43 - 0:00:00 - batch_size: 32
command: python translate.py --exp_name translate --src_lang fr --tgt_lang en --model_path '/home/qtxue/checkpoint.pth' --output_path '/home/qtxue/output.en' --exp_id "19njy282kc"
dump_path: ./dumped/translate/19njy282kc
exp_id: 19njy282kc
exp_name: translate
fp16: False
model_path: /home/qtxue/checkpoint.pth
output_path: /home/qtxue/output.en
src_lang: fr
tgt_lang: en
INFO - 04/25/19 10:48:43 - 0:00:00 - The experiment will be stored in ./dumped/translate/19njy282kc
INFO - 04/25/19 10:48:43 - 0:00:00 - Running command: python translate.py --exp_name translate --src_lang fr --tgt_lang en --model_path '/home/qtxue/checkpoint.pth' --output_path '/home/qtxue/output.en'
INFO - 04/25/19 10:48:48 - 0:00:05 - Supported languages: en, fr
Traceback (most recent call last):
File "translate.py", line 150, in
main(params)
File "translate.py", line 80, in main
encoder.load_state_dict(reloaded['encoder'])
KeyError: 'encoder'
is there some place need to modify or some thing is wrong in my operation?
The text was updated successfully, but these errors were encountered: