针对nGraph的安装介绍及导入model。
nGraph的安装介绍如下。
构建环境:
V0.1.0版本的nnGraph库支持linux系统,有centos7.4-64bit,Ubuntu 16.04 (LTS) 64-bit, 基于Intel Architecture的linux os。注意gcc版本gcc4.8,g++4。
安装步骤:
1、创建目录/opt/libraries
$ sudo mkdir -p /opt/libraries
$ sudo chown -R username:username /opt/libraries
$ cd /opt/libraries
2、下载NervanaSystems系统
$ git clone git@github.com:NervanaSystems/ngraph.git
$ cd ngraph
3、进行build。
创建目录ngraph/src,ngraph/build
$ mkdir build && cd build
然后$ cmake ../
在进行make
$ make
$ make install
4、测试
$ cd build/
$ make check
接下来就可以用libngraph来编译框架(neon,MXNet,TensorFlow framework等)了。
如何导入model:
从ONNX中导入一个模型。
首先安装ngraph_onnx(要求Python 3.4或以上)
1、设置环境变量
export NGRAPH_CPP_BUILD_PATH=$HOME/ngraph_dist
export LD_LIBRARY_PATH=$HOME/ngraph_dist/lib
export DYLD_LIBRARY_PATH=$HOME/ngraph_dist/lib
2、ONNX需要Protocol Buffers version 2.6.1。
$ sudo apt install protobuf-compiler libprotobuf-dev python3-pip
3、check下python_binding的分支。
$ cd /opt/libraries/ngraph
$ git checkout python_binding
Switched to branch 'python_binding'
4、安装依赖。
$ git submodule update --init --recursive
$ cd python
$ pip3 install -r requirements.txt
$ pip3 install
以上记录作为
backup
备忘。
本文暂时没有评论,来添加一个吧(●'◡'●)