Ask Your Question

Revision history [back]

Error on loading ONNX model

Hi, I'm trying to rewrite sample code: https://bleedai.com/facial-expression-recognition-emotion-recognition-with-opencv/ from Python (Jupiter) to C++. Model loading works perfectly in Python (OpenCv v4.4.0), but in C++ it gives me error when parsing ONNX file.

dnn::Net net;

net = dnn::readNetFromONNX("D:/opencv-emotionRecognition/Model/MTCNN/emotion-ferplus-8.onnx");

OpenCV(4.4.0) Error: Unsupported format or combination of formats (Failed to parse onnx model) in cv::dnn::dnn4_v20200609::ONNXImporter::ONNXImporter, file D:\Sviluppo\opencv-4.4.0\modules\dnn\src\onnx\onnx_importer.cpp, line 64

C++ OpenCv is 4.4.0 too. Any suggestion?