jw3126 / ONNXRunTime.jl

Julia bindings for onnxruntime
MIT License
44 stars 9 forks source link

Error: could not load library ... onnxruntime.dll ... The specified module could not be found. #18

Closed cluffa closed 2 years ago

cluffa commented 2 years ago

julia 1.7 + ONNXRunTime v0.3.0 The .dll is definitely there. I deleted my .julia folder and did a fresh install with only ONNXRunTime.jl and Images.jl installed. I have had the code running in wsl, so it appears to be a windows issue. Please let me know if I can provide any more info.

ERROR: could not load library "C:\Users\AlexC\.julia\artifacts\a16d01a5b64dd0f036283f2d89b242e69a0ee03c\onnxruntime-win-x64-1.9.0\lib\onnxruntime.dll"
The specified module could not be found. 
Stacktrace:
  [1] dlopen(s::String, flags::UInt32; throw_error::Bool)
    @ Base.Libc.Libdl .\libdl.jl:117
  [2] dlopen (repeats 2 times)
    @ .\libdl.jl:117 [inlined]
  [3] set_lib!(path::String, execution_provider::Symbol)
    @ ONNXRunTime.CAPI C:\Users\AlexC\.julia\packages\ONNXRunTime\Ad1yw\src\capi.jl:43
  [4] make_lib!(execution_provider::Symbol)
    @ ONNXRunTime.CAPI C:\Users\AlexC\.julia\packages\ONNXRunTime\Ad1yw\src\capi.jl:78
  [5] libptr
    @ C:\Users\AlexC\.julia\packages\ONNXRunTime\Ad1yw\src\capi.jl:95 [inlined]
  [6] OrtGetApiBase(; execution_provider::Symbol)
    @ ONNXRunTime.CAPI C:\Users\AlexC\.julia\packages\ONNXRunTime\Ad1yw\src\capi.jl:312
  [7] #GetApi#2
    @ C:\Users\AlexC\.julia\packages\ONNXRunTime\Ad1yw\src\capi.jl:330 [inlined]
  [8] load_inference(path::String; execution_provider::Symbol, envname::String)
    @ ONNXRunTime C:\Users\AlexC\.julia\packages\ONNXRunTime\Ad1yw\src\highlevel.jl:63
  [9] load_inference(path::String)
    @ ONNXRunTime C:\Users\AlexC\.julia\packages\ONNXRunTime\Ad1yw\src\highlevel.jl:63
 [10] top-level scope
    @ c:\Users\AlexC\workspace\BarTracking.jl\BarTracking.jl:4

My code was only:

using ONNXRunTime, Images
model = ONNXRunTime.load_inference("model.onnx")

If it is model related my model is here: https://github.com/cluffa/bar_tracking/blob/main/BarTracking/timm-regnetx_002_model.onnx

jw3126 commented 2 years ago

I am not a windows expert, but if you run it from DSL, I would expect that it searches for onnxruntime.so instead of onnxruntime.dll? Did you maybe install on windows and run on wsl or vice versa?

cluffa commented 2 years ago

I installed and am running it on windows. I've tried it on another windows computer, and it works fine.
It also has the same error with just using ONNXRuntime_jll.
I will try to purge my julia install and files to fix it. Thanks for the help.

jw3126 commented 2 years ago

Interesting. Note that this package right now does not use ONNXRuntime_jll but ships its own onnxruntime instead.