-
Notifications
You must be signed in to change notification settings - Fork 191
ONNX export not working #403
Comments
I re-trained an RNN model instead of using the pre-trained model because of the name mismatch (version issue?). So, I got encoder and decoder pb files. When I tried to build cpp, it generated error message that Caffe2 is not found. Could you help me to resolve this issue?
|
@ykim362, thanks for the report. I'm in the process of updating the examples. We will also replace the ONNX solution with a PyTorch native export. |
@jmp84 Thanks for the information! I have one more question.
Does this mean Torch Script? Or, another solution? |
@ykim362, yes, I meant Torch Script. |
Does the next update support export to Caffe2? |
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.
fp16=args.fp16,
AttributeError: 'Namespace' object has no attribute 'fp16'
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
The text was updated successfully, but these errors were encountered: