【发布时间】:2019-10-24 21:51:50
【问题描述】:
我有一个用于图像分类的 .NET Core 3 应用,使用 Microsoft 的 ML.NET 框架。
在我的开发机器上,我可以运行代码并且一切正常。
但是,当我将它部署到临时服务器时,我在运行时收到此错误:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
System.DllNotFoundException: Unable to load DLL 'tensorflow' or one of its dependencies: The specified module could not be found. (0x8007007E)
at Tensorflow.c_api.TF_NewGraph()
at Tensorflow.Graph..ctor()
at Microsoft.ML.Transforms.Dnn.DnnUtils.LoadTFSession(IExceptionContext ectx, Byte[] modelBytes, String modelFile)
...
我尝试在部署期间将 tensorflow.dll 复制到 bin 文件夹中;我尝试构建为 x64、x86 或 AnyCPU。我已验证包含 SciSharp.TensorFlow.Redist 和 Microsoft.ML.Tensorflow.Redist NuGet 包。到目前为止没有任何效果。
知道为什么它找不到 DLL 文件,或者我怎样才能让它工作?
【问题讨论】:
-
只是为遇到同样问题的其他人添加:参考这里 - developers.de/2019/10/25/hosting-ml-net-in-appservice,它给了我在哪里看的指针。
标签: c# tensorflow dll asp.net-core-3.0 ml.net