我有一个使用 Microsoft 的 ML.NET 框架进行图像分类的 .NET Core 3 应用程序。
在我的开发计算机上,我可以运行代码,一切正常。
然而,当我将其部署到暂存服务器时,在运行时出现以下错误:
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文件,或者我如何使它工作?