Github上PipeCNN环境配置说明

摘要:

要运行Github上的PipeCNN代码,需要安装Intel OpenCL 和 Intel(Altera) OpenCL for FPGA。 安装顺序不要变,要先安装 Intel OpenCL,后安装 Intel(Altera) OpenCL for FPGA。否则可能出现“No Device founded"。

安装 Intel OpenCL


按照Intel官方安装指南“ Getting Started in Linux with Intel® SDK for OpenCL™ Applications”,intel opencl 分为三步。前两步要先下载‘script', 然后按照指令顺序执行。

  1. 在第一步安装过程中,执行最后一条命令后,在terminal中会有较长时间的静止状态,其实安装依然在进行中,一定不要停止terminal,耐心等待。第一步一共大约需要1个小时来安装。
  2. 执行第二步时,在将'script'改为 '.sh' 文件后,需要在permission中将其选中“Allow executing file as program", 然后才能运行该'script'。接下来安装之前自行下载的SDK安装包。
  3. 暂时可不安装第三步。
安装 Intel(Altera) OpenCL for FPGA
最好安装Pro版本。若只是运行仿真,则standard 和 Pro 版本皆可,如果还要进一步在硬件开发,则需要安装Pro版,否则在编译阶段会出现如下错误:

aoc: This release of Intel(R) FPGA SDK for OpenCL(TM) on A10/S10 requires Quartus Prime Pro Edition. However, the following version was found:
Quartus Prime Shell
Version 17.1.0 Build 590 10/25/2017 SJ Standard Edition
Copyright (C) 2017  Intel Corporation. All rights reserved.
Makefile:139: recipe for target 'conv.aocx' failed
make: *** [conv.aocx] Error 1

而在最后执行 "./run.exe conv.aocx" 时会出现如下错误提示:

***************************************************
PipeCNN: An OpenCL-Based FPGA Accelerator for CNNs
***************************************************
ERROR: CL_DEVICE_NOT_FOUND
Location: ../common/ocl_util.cpp:325
Query for number of devices failed


Note: 如果只运行仿真,不要忽略以下提示:If you want to run software simulations, please change FLOW = hw in the makefile to sw_emu, and source setup_emu.sh before running.

将下载下来的模型的权重等数据放在data文件夹下,然后将整个data文件夹复制进project文件夹中,参考如下路径:
const char *weight_file_path = "./data/data_alex/weights.dat";
const char *input_file_path = "./data/data_alex/image.dat";
const char *ref_file_path = "./data/data_alex/fc8.dat";
const char *dump_file_path = "./result_dump.txt";
其中,'.' 代表run.exe所在的路径。


你可能感兴趣的:(笔记)