Skip to content

cv::dnn::readNetFromONNX pnet load error #15244

@xinyi61

Description

@xinyi61
  • OpenCV => 4.1.1
  • Operating System / Platform => centos x86_64
  • Compiler => gcc
Detailed description

When I load the onnx model (converted from pytorch ) using cv::dnn::readNetFromONNX, it will get the "terminate called after throwing an instance of 'cv::Exception'
what(): OpenCV(4.1.1) /opt/notebook_files/usefull/opencv-4.1.1/modules/dnn/src/dnn.cpp:525: error: (-2:Unspecified error) Can't create layer "23" of type "Exp" in function 'getLayerInstance'"

the script i use to convert pytorch to onnx is:
example = torch.rand(1, 3, 12, 12, requires_grad=True).to(config.DEVICES)
torch_out = torch.onnx._export(pnet,
example,
"pnet_model_final.onnx",
export_params=True)

pnet_Weights.pth

pnet_model_final.onnx

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions