【问题标题】:onnx model in ubuntu 18.04 not runningubuntu 18.04 中的 onnx 模型未运行
【发布时间】:2021-03-28 06:32:08
【问题描述】:

我正在尝试使用 C#、Azure 自定义视觉和 ONNX 模型来实施自定义视觉解决方案。我的 API 代码在 Windows 操作系统上运行完美,但是当我尝试在 Ubuntu 18.04 上运行相同的代码时,出现以下错误。

我已经从 Azure ml 下载了经过训练的 ONNX 模型。

Unhandled exception. System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.DllNotFoundException: Unable to load shared library 'api-ms-win-core-com-l1-1-0.dll' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libapi-ms-win-core-com-l1-1-0.dll: cannot open shared object file: No such file or directory
   at WinRT.Platform.CoIncrementMTAUsage(IntPtr* cookie)
   at WinRT.WinrtModule..ctor()
   --- End of inner exception stack trace ---
   at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean wrapExceptions, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& hasNoDefaultCtor)
   at System.RuntimeType.CreateInstanceDefaultCtorSlow(Boolean publicOnly, Boolean wrapExceptions, Boolean fillCache)
   at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, Boolean wrapExceptions)
   at System.Activator.CreateInstance[T]()
   at System.LazyHelper.CreateViaDefaultConstructor[T]()
   at System.Lazy`1.CreateViaDefaultConstructor()
   at System.Lazy`1.ViaConstructor()
   at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.get_Value()
   at WinRT.WinrtModule.get_Instance()
   at WinRT.WinrtModule.GetActivationFactory(String runtimeClassId)
   at WinRT.BaseActivationFactory..ctor(String typeNamespace, String typeFullName)
   at Windows.Storage.StorageFile._IStorageFileStatics..ctor()
   --- End of inner exception stack trace ---
   at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean wrapExceptions, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& hasNoDefaultCtor)
   at System.RuntimeType.CreateInstanceDefaultCtorSlow(Boolean publicOnly, Boolean wrapExceptions, Boolean fillCache)
   at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, Boolean wrapExceptions)
   at System.Activator.CreateInstance[T]()
   at WinRT.WeakLazy`1.get_Value()
   at Windows.Storage.StorageFile._IStorageFileStatics.get_Instance()
   at Windows.Storage.StorageFile.GetFileFromPathAsync(String path)
   at CustomVisionAPI.Controllers.HomeController.Run() in /home/aaa/bbb/CutomVision/WebApplication1/Controllers/HomeController.cs:line 44
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__139_1(Object state)
   at System.Threading.QueueUserWorkItemCallback.<>c.<.cctor>b__6_0(QueueUserWorkItemCallback quwi)
   at System.Threading.ExecutionContext.RunForThreadPoolUnsafe[TState](ExecutionContext executionContext, Action`1 callback, TState& state)
   at System.Threading.QueueUserWorkItemCallback.Execute()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()

【问题讨论】:

    标签: azure-machine-learning-service onnx microsoft-custom-vision onnxruntime


    【解决方案1】:

    这看起来根本不像是 onnxruntime 问题。

    【讨论】:

    • 我想我需要在 LD_DEBUG 中给出正确的路径。但我不知道该怎么做?如果您有任何想法,请告诉我。谢谢
    猜你喜欢
    • 2020-07-05
    • 2020-03-09
    • 1970-01-01
    • 1970-01-01
    • 2021-02-03
    • 2018-12-01
    • 2018-10-31
    • 2020-09-28
    • 1970-01-01
    相关资源
    最近更新 更多