Skip to content
This repository was archived by the owner on Aug 1, 2023. It is now read-only.
This repository was archived by the owner on Aug 1, 2023. It is now read-only.

ONNX export not working #403

@ykim362

Description

@ykim362

pytorch_translate/examples/export_iwslt14.sh

This example doesn't work for me.
Would you be able to help me to run the example script?

I tried to fix the errors one by one, by removing parameters, but couldn't succeed to export.

  1. onnx_component_export.py: error: unrecognized arguments: --batched-beam
  2. File "/data/repos/translate/pytorch_translate/rnn.py", line 526, in build_single_decoder
    fp16=args.fp16,
    AttributeError: 'Namespace' object has no attribute 'fp16'
  3. Exception has occurred: RuntimeError
    Error(s) in loading state_dict for RNNModel: Missing key(s) in state_dict: "encoder.bilstm.layers.0.weight_ih_l0", "encoder.bilstm.layers.0.weight_hh_l0", "encoder.bilstm.layers.0.bias_ih_l0", "encoder.bilstm.layers.0.bias_hh_l0", "encoder.bilstm.layers.0.weight_ih_l0_reverse", "encoder.bilstm.layers.0.weight_hh_l0_reverse", "encoder.bilstm.layers.0.bias_ih_l0_reverse", "encoder.bilstm.layers.0.bias_hh_l0_reverse", "encoder.bilstm.layers.1.weight_ih_l0", "encoder.bilstm.layers.1.weight_hh_l0", "encoder.bilstm.layers.1.bias_ih_l0", "encoder.bilstm.layers.1.bias_hh_l0". Unexpected key(s) in state_dict: "encoder.layers.0.weight_ih_l0", "encoder.layers.0.weight_hh_l0", "encoder.layers.0.bias_ih_l0", "encoder.layers.0.bias_hh_l0", "encoder.layers.0.weight_ih_l0_reverse", "encoder.layers.0.weight_hh_l0_reverse", "encoder.layers.0.bias_ih_l0_reverse", "encoder.layers.0.bias_hh_l0_reverse", "encoder.layers.1.weight_ih_l0", "encoder.layers.1.weight_hh_l0", "encoder.layers.1.bias_ih_l0", "encoder.layers.1.bias_hh_l0".
    File "\opt\conda\lib\python3.6\site-packages\torch\nn\modules\module.py", line 771, in load_state_dict
    File "\opt\conda\lib\python3.6\site-packages\fairseq\models\fairseq_model.py", line 66, in load_state_dict
    File "D:\repos\translate\pytorch_translate\ensemble_export.py", line 122, in load_models_from_checkpoints
    File "D:\repos\translate\pytorch_translate\ensemble_export.py", line 414, in build_from_checkpoints
    File "D:\repos\translate\pytorch_translate\onnx_component_export.py", line 116, in export
    File "D:\repos\translate\pytorch_translate\onnx_component_export.py", line 88, in main
    File "D:\repos\translate\pytorch_translate\onnx_component_export.py", line 156, in

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions