OpenCV and deep learning neural networks

Finally i decided to start with the following bunch: OpenCV DNN module + Lobe.ai

I successfully trained the model with Lobe (https://www.lobe.ai/) and make two exports for a test one export is a tensorflow “model.pb” format, another is “model.onnx” format, but both of them doesn’t work, i stucked even on model loading part of the code.

Tensorflow load example:

    // load the neural network model
    auto model = cv::dnn::readNet("input/saved_model.pb");
    
    // also try this way
     auto model = cv::dnn::readNetFromTensorflow("input/saved_model.pb");

ONNX load example:

 // load the neural network model
    auto model = cv::dnn::readNetFromONNX("input/model.onnx");

Please help me to win the errors. Thank you

Here is the errors attached when i hit the readNet functions

ONNX errors:

[ERROR:0] global D:\build\opencv_next\modules\dnn\src\onnx\onnx_importer.cpp (2110) cv::dnn::dnn5_v20210608::ONNXImporter::handleNode DNN/ONNX: ERROR during processing node with 1 inputs and 1 outputs: [ReduceMean]:(saved_resnet_50_model/resnet50v2/avg_pool/Mean:0)
OpenCV: terminate handler is called! The last OpenCV error is:
OpenCV(5.0.0-pre) Error: Unspecified error (> Node [ReduceMean]:(saved_resnet_50_model/resnet50v2/avg_pool/Mean:0) parse error: OpenCV(5.0.0-pre) D:\build\opencv_next\modules\dnn\src\onnx\onnx_importer.cpp:725: error: (-215:Assertion failed) axis >= 2 + i in function 'cv::dnn::dnn5_v20210608::ONNXImporter::handleNode'
> ) in cv::dnn::dnn5_v20210608::ONNXImporter::handleNode, file D:\build\opencv_next\modules\dnn\src\onnx\onnx_importer.cpp, line 2129