Skip to content

How to export Pytorch model with custom op to ONNX and run it in ONNX Runtime #294

Description

@flower1s

In this path of the project: https://github.com/onnx/tutorials/blob/main/PyTorchCustomOperator/README.md; I attempted to compile onnxruntime according to the specified tutorial, but the following error occurred.

[1] 1169287
-- Configuring done (0.3s)
-- Configuring done (0.3s)
-- Generating done (0.4s)
-- Generating done (0.4s)
-- Build files have been written to: /afs/ihep.ac.cn/users/m/miaofeng/miaofeng/runboss/python/onnx_work/pytorchcustomoperater/ort_custom_op/build
-- Build files have been written to: /afs/ihep.ac.cn/users/m/miaofeng/miaofeng/runboss/python/onnx_work/pytorchcustomoperater/ort_custom_op/build
[ 33%] Building CXX object CMakeFiles/customop.dir/custom_op.cc.o
/afs/ihep.ac.cn/users/m/miaofeng/miaofeng/runboss/python/onnx_work/pytorchcustomoperater/ort_custom_op/custom_op.cc:16:22: error: expected initializer before '<' token
16 | void GroupNormKernel::Compute(OrtKernelContext* context) {
| ^
make[2]: *** [CMakeFiles/customop.dir/build.make:76: CMakeFiles/customop.dir/custom_op.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/customop.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
[1]+ Done cmake ..

I am unable to solve it personally and hope to receive detailed guidance.
Best wishes!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions