error CS0246: 未能找到类型或命名空间名“IExample”
问题描述:
vs2017 .NET CORE 2.2
源代码:
using System;
using System.Diagnostics;
using System.Text;
using Tensorflow;
using static Tensorflow.Binding;
namespace TensorFlowNET.Examples
{
/// <summary>
/// Simple hello world using TensorFlow
/// </summary>
public class HelloWorld : IExample
{
public void Run()
{
/* Create a Constant op
The op is added as a node to the default graph.
The value returned by the constructor represents the output
of the Constant op. */
var hello = tf.constant("Hello, TensorFlow!");
// Start tf session
using (var sess = tf.Session())
{
// Run the op
var result = sess.run(hello);
Console.WriteLine(result);
}
}
}
}
报错:error CS0246: 未能找到类型或命名空间名“IExample”(是否缺少 using 指令或程序集引用?)
网上到处都找不到答案
源代码来自https://tensorflownet.readthedocs.io/en/latest/HelloWorld.html
答
问你啊IExample,这个接口哪里定义的。
或者你自己补一个看看呢
public interface IExample
{
void Run();
}