0

我正在尝试使用 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()
4

1 回答 1

0

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

于 2021-03-29T21:55:49.807 回答