简体   繁体   English

无法在 Windows 2012 R2 服务器上加载 DLL“tensorflow”

[英]Unable to load DLL 'tensorflow' on Windows 2012 R2 Server

I have created an image classifier using ML.Net Model Builer in Visual Studio on Windows 10. It has been compiled in to a Console application.我在 Windows 10 上的 Visual Studio 中使用 ML.Net 模型构建器创建了一个图像分类器。它已被编译到控制台应用程序中。 This runs fine on the development machine and other Windows 10 machines.这在开发机器和其他 Windows 10 机器上运行良好。 I need to deploy it to a Windows 2012 R2 server but when I start the application I get this error message:我需要将它部署到 Windows 2012 R2 服务器,但是当我启动应用程序时,我收到以下错误消息:

System.Reflection.TargetInvocationException: Exception has been thrown by the ta
rget of an invocation. ---> System.Reflection.TargetInvocationException: Excepti
on has been thrown by the target of an invocation. ---> System.Reflection.Target
InvocationException: Exception has been thrown by the target of an invocation. -
--> System.Reflection.TargetInvocationException: Exception has been thrown by th
e target of an invocation. ---> System.DllNotFoundException: Unable to load DLL
'tensorflow': A dynamic link library (DLL) initialization routine failed. (Excep
tion from HRESULT: 0x8007045A)
   at Tensorflow.c_api.TF_NewGraph()
   at Tensorflow.Graph..ctor()
   at Microsoft.ML.TensorFlow.TensorFlowUtils.LoadTFSession(IExceptionContext ec
tx, Byte[] modelBytes, String modelFile)
   at Microsoft.ML.Vision.ImageClassificationModelParameters..ctor(IHostEnvironm
ent env, ModelLoadContext ctx)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments,
 Signature sig, Boolean constructor)
   at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, B
inder binder, Object[] parameters, CultureInfo culture)
   at Microsoft.ML.Runtime.ComponentCatalog.LoadableClassInfo.CreateInstanceCore
(Object[] ctorArgs)
   at Microsoft.ML.Runtime.ComponentCatalog.TryCreateInstance[TRes](IHostEnviron
ment env, Type signatureType, TRes& result, String name, String options, Object[
] extra)
   at Microsoft.ML.Runtime.ComponentCatalog.TryCreateInstance[TRes,TSig](IHostEn
vironment env, TRes& result, String name, String options, Object[] extra)
   at Microsoft.ML.ModelLoadContext.TryLoadModelCore[TRes,TSig](IHostEnvironment
 env, TRes& result, Object[] extra)
   at Microsoft.ML.ModelLoadContext.TryLoadModel[TRes,TSig](IHostEnvironment env
, TRes& result, RepositoryReader rep, Entry ent, String dir, Object[] extra)
   at Microsoft.ML.ModelLoadContext.LoadModel[TRes,TSig](IHostEnvironment env, T
Res& result, RepositoryReader rep, Entry ent, String dir, Object[] extra)
   at Microsoft.ML.ModelLoadContext.LoadModelOrNull[TRes,TSig](IHostEnvironment
env, TRes& result, RepositoryReader rep, String dir, Object[] extra)
   at Microsoft.ML.ModelLoadContext.LoadModel[TRes,TSig](IHostEnvironment env, T
Res& result, String name, Object[] extra)
   at Microsoft.ML.Data.MulticlassPredictionTransformer.Create(IHostEnvironment
env, ModelLoadContext ctx)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments,
 Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Objec
t[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invoke
Attr, Binder binder, Object[] parameters, CultureInfo culture)
   at Microsoft.ML.Runtime.ComponentCatalog.LoadableClassInfo.CreateInstanceCore
(Object[] ctorArgs)
   at Microsoft.ML.Runtime.ComponentCatalog.TryCreateInstance[TRes](IHostEnviron
ment env, Type signatureType, TRes& result, String name, String options, Object[
] extra)
   at Microsoft.ML.Runtime.ComponentCatalog.TryCreateInstance[TRes,TSig](IHostEn
vironment env, TRes& result, String name, String options, Object[] extra)
   at Microsoft.ML.ModelLoadContext.TryLoadModelCore[TRes,TSig](IHostEnvironment
 env, TRes& result, Object[] extra)
   at Microsoft.ML.ModelLoadContext.TryLoadModel[TRes,TSig](IHostEnvironment env
, TRes& result, RepositoryReader rep, Entry ent, String dir, Object[] extra)
   at Microsoft.ML.ModelLoadContext.LoadModel[TRes,TSig](IHostEnvironment env, T
Res& result, RepositoryReader rep, Entry ent, String dir, Object[] extra)
   at Microsoft.ML.ModelLoadContext.LoadModelOrNull[TRes,TSig](IHostEnvironment
env, TRes& result, RepositoryReader rep, String dir, Object[] extra)
   at Microsoft.ML.ModelLoadContext.LoadModel[TRes,TSig](IHostEnvironment env, T
Res& result, String name, Object[] extra)
   at Microsoft.ML.Data.TransformerChain`1..ctor(IHostEnvironment env, ModelLoad
Context ctx)
   at Microsoft.ML.Data.TransformerChain.Create(IHostEnvironment env, ModelLoadC
ontext ctx)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments,
 Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Objec
t[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invoke
Attr, Binder binder, Object[] parameters, CultureInfo culture)
   at Microsoft.ML.Runtime.ComponentCatalog.LoadableClassInfo.CreateInstanceCore
(Object[] ctorArgs)
   at Microsoft.ML.Runtime.ComponentCatalog.TryCreateInstance[TRes](IHostEnviron
ment env, Type signatureType, TRes& result, String name, String options, Object[
] extra)
   at Microsoft.ML.Runtime.ComponentCatalog.TryCreateInstance[TRes,TSig](IHostEn
vironment env, TRes& result, String name, String options, Object[] extra)
   at Microsoft.ML.ModelLoadContext.TryLoadModelCore[TRes,TSig](IHostEnvironment
 env, TRes& result, Object[] extra)
   at Microsoft.ML.ModelLoadContext.TryLoadModel[TRes,TSig](IHostEnvironment env
, TRes& result, RepositoryReader rep, Entry ent, String dir, Object[] extra)
   at Microsoft.ML.ModelLoadContext.LoadModel[TRes,TSig](IHostEnvironment env, T
Res& result, RepositoryReader rep, Entry ent, String dir, Object[] extra)
   at Microsoft.ML.ModelLoadContext.LoadModelOrNull[TRes,TSig](IHostEnvironment
env, TRes& result, RepositoryReader rep, String dir, Object[] extra)
   at Microsoft.ML.ModelLoadContext.LoadModel[TRes,TSig](IHostEnvironment env, T
Res& result, String name, Object[] extra)
   at Microsoft.ML.Data.TransformerChain`1..ctor(IHostEnvironment env, ModelLoad
Context ctx)
   at Microsoft.ML.Data.TransformerChain.Create(IHostEnvironment env, ModelLoadC
ontext ctx)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments,
 Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Objec
t[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invoke
Attr, Binder binder, Object[] parameters, CultureInfo culture)
   at Microsoft.ML.Runtime.ComponentCatalog.LoadableClassInfo.CreateInstanceCore
(Object[] ctorArgs)
   at Microsoft.ML.Runtime.ComponentCatalog.TryCreateInstance[TRes](IHostEnviron
ment env, Type signatureType, TRes& result, String name, String options, Object[
] extra)
   at Microsoft.ML.Runtime.ComponentCatalog.TryCreateInstance[TRes,TSig](IHostEn
vironment env, TRes& result, String name, String options, Object[] extra)
   at Microsoft.ML.ModelLoadContext.TryLoadModelCore[TRes,TSig](IHostEnvironment
 env, TRes& result, Object[] extra)
   at Microsoft.ML.ModelLoadContext.TryLoadModel[TRes,TSig](IHostEnvironment env
, TRes& result, RepositoryReader rep, Entry ent, String dir, Object[] extra)
   at Microsoft.ML.ModelLoadContext.LoadModel[TRes,TSig](IHostEnvironment env, T
Res& result, RepositoryReader rep, Entry ent, String dir, Object[] extra)
   at Microsoft.ML.ModelLoadContext.LoadModelOrNull[TRes,TSig](IHostEnvironment
env, TRes& result, RepositoryReader rep, String dir, Object[] extra)
   at Microsoft.ML.ModelLoadContext.LoadModel[TRes,TSig](IHostEnvironment env, T
Res& result, RepositoryReader rep, String dir, Object[] extra)
   at Microsoft.ML.ModelOperationsCatalog.Load(Stream stream, DataViewSchema& in
putSchema)
   at Microsoft.ML.ModelOperationsCatalog.Load(String filePath, DataViewSchema&
inputSchema)
   at Gatehouse.AI.KeyClassification.KeyClassifierModel..ctor()
   at delmedelme.Proxy.IsKey() in C:\xxxxxxxx.cs:line 18

Can anyone suggest how I can fix this?谁能建议我如何解决这个问题?

Thanks谢谢

I was stuck in the same issue.我陷入了同样的问题。

The solution was to Add Feature "Desktop Experience", which is not by default included in W2012 installation.解决方案是添加功能“桌面体验”,W2012 安装中默认不包含该功能。

I hope that helps in your case!我希望这对您的情况有所帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 DirectX 应用程序无法通过 Process.Start 在 Windows Server 2012 R2 上加载,通过 CMD 或在本地计算机上正常工作 - DirectX app unable to load through Process.Start on Windows Server 2012 R2, works fine through CMD or on local machine Windows Server 2012 r2 中的波斯文化 - Persian culture in Windows Server 2012 r2 无法加载DLL'SQLite.Interop.dll':找不到指定的模块。 Windows Server 2012上的错误 - Unable to load DLL 'SQLite.Interop.dll': The specified module could not be found. Error on Windows Server 2012 Windows Server 2012 R2上Windows Service Platform上的WCFNotSupportedException - WCF on Windows Service PlatformNotSupportedException On Windows Server 2012 R2 在 Windows Server 2012 R2 上构建的应用程序在 Windows Server 2008 R2 上失败 - Application built on Windows Server 2012 R2 fails on windows server 2008 R2 Windows Server 2012 R2上的意外崩溃WCF服务 - Unexpected crash WCF Service on Windows Server 2012 R2 Active Directory中的用户身份验证-Windows Server 2012 R2 - User Authentication in Active Directory - Windows Server 2012 R2 在Windows Server 2012 R2上发送http / 2请求 - send http/2 request on windows server 2012 R2 将 .net core 项目部署到 Windows Server 2012 r2 - Deploy .net core project to Windows Server 2012 r2 在Windows Server 2012 r2上部署时出现BadImageFormatException - BadImageFormatException when deploying on windows server 2012 r2
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM