Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yolo5_small_darknet load in opencv #252

Open
ksv87 opened this issue Oct 17, 2024 · 0 comments
Open

yolo5_small_darknet load in opencv #252

ksv87 opened this issue Oct 17, 2024 · 0 comments

Comments

@ksv87
Copy link

ksv87 commented Oct 17, 2024

I trained yolo5_small_darknet
Dump model with yolo.py
Convert it to onnx with keras_to_onnx.py
Convert it to frozen pb with keras_to_tensorflow.py
Convert it to tflite with post_train_quant_convert.py

I try load frozen pb in opencv

tf = cv2.dnn.readNetFromTensorflow("test.pb")
error: OpenCV(4.10.0) D:\a\opencv-python\opencv-python\opencv\modules\dnn\src\tensorflow\tf_importer.cpp:2877: error: (-2:Unspecified error) More than one input is Const op in function 'cv::dnn::dnn4_v20240521::`anonymous-namespace'::TFImporter::getConstBlob'

I try load tflite in opencv

tflite = cv2.dnn.readNetFromTFLite("test.tflite")
error: OpenCV(4.10.0) D:\a\opencv-python\opencv-python\opencv\modules\dnn\src\tflite\tflite_importer.cpp:246: error: (-213:The function/feature is not implemented) Unsupported operator type STRIDED_SLICE in function 'cv::dnn::dnn4_v20240521::TFLiteImporter::populateNet'

I try load onnx in opencv

onnx = cv2.dnn.readNetFromONNX("test.onnx")
It's work

What I do wrong? How load frozen pb model in opencv? How load tflite model in opencv?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant