blavsth 2020-04-01 23:58 采纳率: 66.7%
浏览 945

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

  • 写回答

1条回答 默认 最新

  • threenewbee 2020-04-02 00:07
    关注

    问你啊IExample,这个接口哪里定义的。
    或者你自己补一个看看呢
    public interface IExample
    {
    void Run();
    }

    评论

报告相同问题?

悬赏问题

  • ¥188 寻找能做王者评分提取的
  • ¥15 matlab用simulink求解一个二阶微分方程,要求截图
  • ¥30 乘子法解约束最优化问题的matlab代码文件,最好有matlab代码文件
  • ¥15 写论文,需要数据支撑
  • ¥15 identifier of an instance of 类 was altered from xx to xx错误
  • ¥100 反编译微信小游戏求指导
  • ¥15 docker模式webrtc-streamer 无法播放公网rtsp
  • ¥15 学不会递归,理解不了汉诺塔参数变化
  • ¥15 基于图神经网络的COVID-19药物筛选研究
  • ¥30 软件自定义无线电该怎样使用