Converting biomegatron to onnx
Describe the bug
Hi, I am trying to convert Biomegatron Model finetuned for token classification tasks using nemo to onnx format. I am getting the following error:
ARNING: The shape inference of prim::PythonOp type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function.
WARNING: The shape inference of prim::PythonOp type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function.
WARNING: The shape inference of prim::PythonOp type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function.
WARNING: The shape inference of prim::PythonOp type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function.
WARNING: The shape inference of prim::PythonOp type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function.
WARNING: The shape inference of prim::PythonOp type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function.
WARNING: The shape inference of prim::PythonOp type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function.
WARNING: The shape inference of prim::PythonOp type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function.
WARNING: The shape inference of prim::PythonOp type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function.
WARNING: The shape inference of prim::PythonOp type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function.
WARNING: The shape inference of prim::PythonOp type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function.
WARNING: The shape inference of prim::PythonOp type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function.
WARNING: The shape inference of prim::PythonOp type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function.
WARNING: The shape inference of prim::PythonOp type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function.
WARNING: The shape inference of prim::PythonOp type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function.
WARNING: The shape inference of prim::PythonOp type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function.
WARNING: The shape inference of prim::PythonOp type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function.
WARNING: The shape inference of prim::PythonOp type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function.
WARNING: The shape inference of prim::PythonOp type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function.
WARNING: The shape inference of prim::PythonOp type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function.
[NeMo E 2022-08-08 14:55:29 export:164] Export failed. Please make sure your NeMo model class (<class 'nemo.collections.nlp.models.token_classification.token_classification_model.TokenClassificationModel'>) has working export() and that you have the latest NeMo package installed with [all] dependencies.
Traceback (most recent call last):
File "export.py", line 173, in
Steps/Code to reproduce bug I'm using the script export.py used in the below tutorial: [(https://github.com/NVIDIA/NeMo/blob/main/tutorials/nlp/MegatronBert_export.ipynb)]
Please, download export.py from here: [(https://raw.githubusercontent.com/NVIDIA/NeMo/{BRANCH}/scripts/export.py)]
Also, tried model.export('model.onnx') separately and getting the same error.
Environment overview (please complete the following information)
- Environment location: Docker, GCP
- docker pull nvcr.io/nvidia/nemo:22.05
Environment details
NeMo container: nvcr.io/nvidia/nemo:22.05 NeMo version: 1.10.0 Branch: 'Main' Biomegatron Model: "biomegatron345m_biovocab_50k_cased"