macOS下使用.NET 7运行TensorFlow.NET时遇DllNotFoundException错误求助
macOS .NET 7环境下TensorFlow.NET加载库失败问题
我尝试在macOS系统的.NET 7环境中运行基础TensorFlow相关代码,以下是我的.proj文件内容:
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Exe</OutputType> <TargetFramework>net7.0</TargetFramework> <ImplicitUsings>enable</ImplicitUsings> <Nullable>enable</Nullable> </PropertyGroup> <ItemGroup> <PackageReference Include="SciSharp.TensorFlow.Redist" Version="2.11.3" /> <PackageReference Include="TensorFlow.Keras" Version="0.10.5" /> <PackageReference Include="TensorFlow.NET" Version="0.100.5" /> </ItemGroup> </Project>
当我尝试运行代码时出现如下错误,我已按照官方指南在本机安装了TensorFlow:
Unhandled exception. System.DllNotFoundException: Unable to load shared library 'tensorflow' or one of its dependencies. In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES environment variable:
dlopen(/usr/local/share/dotnet/shared/Microsoft.NETCore.App/7.0.5/tensorflow.dylib, 0x0001)
以下是我的基础代码:
内容的提问来源于stack exchange,提问作者tmp dev
相关产品推荐
相关产品推荐

