• windows下OpenNN的编译与使用


    下载OpenNN

    OpenNN是C++编写的神经网络库,从官网上下载后,使用VisualStudio打开可见如下项目树
    在这里插入图片描述

    其中项目opennn是用于生成静态链接库的,而其他所有项目都是案例。右键点击项目opennn,然后选择生成,VS将会自动编译出opennn.lib文件。新项目必须包含这个lib文件。

    仅有lib文件是不够的,还需要一系列头文件来说明这个lib文件内部到底有什么函数。opennn的所有头文件(.h)都存放在./opennn目录下。

    新建项目

    (1)新建一个C++控制台项目
    (2)在根目录新建lib文件夹,将opennn.lib文件复制到该文件夹中
    (3)在根目录新建include文件夹,把opennn的所有头文件(.h)都复制到该文件夹中
    (4)打开项目属性,设置包含目录,如下图
    在这里插入图片描述
    (5)设置链接的库文件,如下图
    在这里插入图片描述
    (6)项目的cpp文件中写入以下代码。这段代码来自./blank,意思是一个空的神经网络项目,不实现任何功能

    //   OpenNN: Open Neural Networks Library
    //   www.opennn.org
    //
    //   B L A N K   A P P L I C A T I O N
    //
    //   Artificial Intelligence Techniques SL
    //   artelnics@artelnics.com
    
    // System includes
    
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    
    // Systems Complementaries
    
    #include 
    #include 
    #include 
    
    
    // OpenNN includes
    
    #include "opennn.h"
    
    using namespace OpenNN;
    using namespace std;
    using namespace chrono;
    
    
    
    int main(void)
    {
        try
        {
            cout << "OpenNN. Blank Application." << endl;
    
            return 0;
        }
        catch(exception& e)
        {
            cerr << e.what() << endl;
    
            return 1;
        }
    }
    
    
    // OpenNN: Open Neural Networks Library.
    // Copyright(C) 2005-2020 Artificial Intelligence Techniques, SL.
    //
    // This library is free software; you can redistribute it and/or
    // modify it under the terms of the GNU Lesser General Public
    // License as published by the Free Software Foundation; either
    // version 2.1 of the License, or any later version.
    //
    // This library is distributed in the hope that it will be useful,
    // but WITHOUT ANY WARRANTY; without even the implied warranty of
    // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    // Lesser General Public License for more details.
    // You should have received a copy of the GNU Lesser General Public
    // License along with this library; if not, write to the Free Software
    // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74

    (7)编译运行之后显示

    OpenNN. Blank Application.
    
    • 1

    说明opennn已经可以正常运行

    最后,我把lib文件夹和include文件夹整理如下,如有需要即可下载:
    https://download.csdn.net/download/weixin_43325228/86246277

  • 相关阅读:
    关于git版本控制在IDEA中的使用
    JavaScript新特性 async和await
    电商项目part10 高并发缓存实战
    ConcurrentHashMap源码解读(jdk1.8以上版本)
    win11安装mysql-8.0.28
    Revit MEP 平面视图中(立管)怎么设置二维表达?
    每日一题:什么是单点登录?如何实现?
    go-redis之初始化连接
    芯片调试记录,芯片频率,添加摄像头,CAN,SPI
    RK3399平台开发系列讲解(USB篇)如何去学习USB驱动 - 视频课
  • 原文地址:https://blog.csdn.net/weixin_43325228/article/details/125887630