FourierMourier / yolov8-onnx-cpp

YOLOv8 C++ Instance Segmentation, Pose Estimation and Object Detection with ONNX
Apache License 2.0
103 stars 23 forks source link

fixed create session error due to modelPathW for linux - minor changes #4

Closed bhavya-goyal-22 closed 7 months ago

bhavya-goyal-22 commented 7 months ago

Issue

On Linux, while building it gave me this error due to modelPathW type.

yolov8-onnx-cpp/src/nn/onnx_model_base.cpp: In constructor ‘OnnxModelBase::OnnxModelBase(const char*, const char*, const char*)’:
yolov8-onnx-cpp/src/nn/onnx_model_base.cpp:62:67: error: no matching function for call to ‘Ort::Session::Session(Ort::Env&, const wchar_t*, Ort::SessionOptions&)’
   62 |     session = Ort::Session(env, modelPathW.c_str(), sessionOptions);
      |                                                                   ^

Correction

Isolated the relevant line for Windows and Linus users so that they could comment it out as per their Operating System.

FourierMourier commented 7 months ago

Hi! Sorry for the late response. The version you provided is not compiling on win, but I'll add in a moment a workaround using macros - please check whether it works in your case or not

bhavya-goyal-22 commented 7 months ago

Hey! i checked it and now it works for Linux operating system as well

FourierMourier commented 7 months ago

Glad to hear that. Thanks for contributing!