YOLOv8WithOpenCVForUnityExample icon indicating copy to clipboard operation
YOLOv8WithOpenCVForUnityExample copied to clipboard

Running with error for can't read ONNX file

Open yunlianwangluo opened this issue 1 year ago • 1 comments

After following steps for setting up project. every thing just looks fine, but when I try to run it, error happened: dnn::readNet_12() : OpenCV(4.10.0-dev) C:\Users\satoo\Desktop\opencv\modules\dnn\src\onnx\onnx_importer.cpp:277: error: (-5:Bad argument) Can't read ONNX file: C:/Users/David/YOLOv8WithOpenCVForUnityExample/Assets/StreamingAssets\YOLOv8WithOpenCVForUnityExample/yolov8n-seg.onnx in function 'cv::dnn::dnn4_v20240521::ONNXImporter::ONNXImporter'

And I had checked with the directory path, the file do exist and the file attributes are all good for anyone accessing.

Any idea for solving this?

yunlianwangluo avatar Aug 07 '24 13:08 yunlianwangluo

From the error text it seems that the onnx model file is incorrect, but we do not know why this is the case. What about other model examples? (YOLOv8ObjectDetection or YOLOv8Classification) We have confirmed that the problem does not occur in a project set up in our environment (Windows, Editor) using the latest version of OpenCVForUniy. The completed project has the following file structure. 2024-08-09_04h08_53

EnoxSoftware avatar Aug 08 '24 19:08 EnoxSoftware