我有一个用于图像分类的 .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 文件,或者如何让它工作吗?
安装了“SciSharp.TensorFlow.Redist”版本1.14.0,这个问题现在消失了。
我的包参考如下:
<PackageReference Include="Microsoft.ML" Version="1.4.0" />
<PackageReference Include="Microsoft.ML.ImageAnalytics" Version="1.4.0" />
<PackageReference Include="Microsoft.ML.Vision" Version="1.4.0" />
<PackageReference Include="SciSharp.TensorFlow.Redist" Version="1.14.0" />
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)