我是C#的新手,我已经研究这个错误很长时间了。
我想在Visual中使用经过训练的TensorFlow模型和TensorFlow so,所以我创建了一个.NET控制台项目,并使用内置包管理器从nuget.org安装了Tensorflowsharp 1.13.0。
但是,当我在Program.cs中包含以下代码时
using System;
using TensorFlow;
namespace ai
{
class MainClass
{
public static void Main(string[] args)
{
var graph = new TFGraph();
}
}
} 我收到了一条错误消息:
Unhandled Exception:
System.DllNotFoundException: libtensorflow
at (wrapper managed-to-native) TensorFlow.TFGraph.TF_NewGraph()
at TensorFlow.TFGraph..ctor () [0x00022] in <a8cd6d02fde04a81817b4f25d24a7be9>:0根据我找到的一些帖子,这可能说明libtensorflow.dylib不在bin/Debug/目录中,但是当我查看它时,我在里面找到了这个文件。
我做错了什么?
我的环境设置:
非常感谢你的帮助!
发布于 2019-07-12 03:15:06
试着换到64位。
这可能对你的回答不正确。但试试看。我没有mac环境。但是我尝试过woth .net核心和TensorflowSharp,它工作得很好。同时,我尝试了.net框架,我也得到了dll未找到的问题和BadImageFormatException。
https://github.com/migueldeicaza/TensorFlowSharp/issues/103 https://github.com/migueldeicaza/TensorFlowSharp/issues/103
https://stackoverflow.com/questions/56999342
复制相似问题