更新时间:2021-10-26 GMT+08:00
分享

搭建软件开发环境

按照获取软件包节的方法获取了软件版本,且按照确认Atlas 500软件版本节确认软件版本一致性后,开始搭建软件开发环境。

  1. 准备一台x86 CPU的服务器(或者PC)用作开发主机。为开发主机安装好ubuntu 16.04 LTS操作系统(如开发主机已安装好其他版本的操作系统,也可在该主机上安装虚拟机,再安装ubuntu 16.04 LTS操作系统用于开发)。

    ubuntu 16.04 LTS操作系统镜像下载地址:http://old-releases.ubuntu.com/releases/

  2. 配置开发主机网络,确保开发主机和Atlas 500在同一个局域网内。
  3. 获取软件包节获取到的软件包文件拷贝到开发主机的任意目录(如“/home”)。
  4. 执行以下命令创建Atlas 500 DDK需要安装的目录(如“/home/Atlas500_DDK”)。

    mkdir -p /home/Atlas500_DDK

  5. “A500-3000_A500-3010_A200-3000HiLens-DDK-Vx.x.x.x.tar.gz”文件所在目录下执行如下命令将Atlas 500 DDK文件安装到创建好的目录。

    tar -zxvf A500-3000_A500-3010_A200-3000HiLens-DDK-Vx.x.x.x.tar.gz -C /home/Atlas500_DDK

    “A500-3000_A500-3010_A200-3000HiLens-DDK-Vx.x.x.x.tar.gz”的版本号以获取的实际包名为准。

  6. “Euler_compile_env_cross.tar.gz”文件所在目录下执行如下命令将Atlas 500 Host交叉编译工具链安装到已创建的Atlas 500 DDK安装目录。

    tar -zxvf Euler_compile_env_cross.tar.gz -C /home/Atlas500_DDK/toolchains

  7. 执行命令cd /home/Atlas500_DDK进入Atlas 500 DDK安装目录。

    再执行命令cat ddk_info查看安装的Atlas 500 DDK版本,确认DDK版本信息是否正确。

  8. 执行命令vi ~/.bashrc打开操作系统中当前用户的环境配置文件,并在该文件的结尾添加如下内容:

    export DDK_HOME=/home/Atlas500_DDK
    export PATH=$PATH:$DDK_HOME/host/bin
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$DDK_HOME/host/lib

    添加完成后,执行命令source ~/.bashrc使之生效。

  9. 在$DDK_HOME的lib64文件夹下添加软连接,按以下命令操作:

    cd /home/Atlas500_DDK/lib64
    ln -s libssl.so.1.1 libssl.so
    ln -s libcrypto.so.1.1 libcrypto.so
    ln -s libprotobuf.so.15 libprotobuf.so

  10. 如果上述步骤均未报错,并且在操作系统任意目录下执行omg -h,输出类似如下所示信息,表示Atlas 500开发环境搭建成功。否则,Atlas 500开发环境搭建失败,详细请参考如何获取帮助

    omg: usage: ./omg <args>
    example:
    ./omg --model=./alexnet.prototxt --weight=./alexnet.caffemodel
    --framework=0 --output=./domi
    aguments explain:
      --model             Model file
      --weight            Weight file. Required when framework is Caffe
      --framework         Framework type(0:Caffe; 3:Tensorflow)
      --output            Output file path&name(needn't suffix, will add .om automatically)
      --encrypt_mode      Encrypt flag. 0: encrypt; -1(default): not encrypt
      --encrypt_key       Encrypt_key file
      --certificate       Certificate file
      --hardware_key      ISV file
      --private_key       Private key file
      --input_shape       Shape of input data. E.g.: "input_name1:n1,c1,h1,w1;input_name2:n2,c2,h2,w2"
      --h/help            Show this help message
      --cal_conf          Calibration config file
      --insert_op_conf    Config file to insert new op
      --op_name_map       Custom op name mapping file
      --plugin_path       Custom op plugin path. Default value is: "./plugin". E.g.: "path1;path2;path3".
                          Note: A semicolon(;) cannot be included in each path, otherwise the resolved path will not match the expected one.
      --om                The model file to be converted to json
      --json              The output json file path&name which is converted from a model
      --mode              Run mode. 0(default): model => davinci; 1: framework/davinci model => json; 3: only pre-check
      --target            Target platform. (mini)
      --out_nodes         Output nodes designated by users. E.g.: "node_name1:0;node_name1:1;node_name2:0"
      --input_format      Format of input data. E.g.: "NCHW"
      --perf_level        Performance level. -1(default): generate a task-sink-model with ub-fuison and l2-fusion;
                          3: generate task-sink-model without l2-fusion; 4: task-sink-model without ub-fusion and l2-fusion.
      --check_report      The pre-checking report file. Default value is: "check_result.json"
      --input_fp16_nodes  Input node datatype is fp16 and format is NCHW. E.g.: "node_name1;node_name2"
      --is_output_fp16    Net output node datatype is fp16 and format is NCHW, or not. E.g.: "false,true,false,true"
      --ddk_version       The ddk version. E.g.: "x.y.z.Patch.B350"
      --net_format        Set net prior format. ND: select op's ND format preferentially; 5D: select op's 5D format preferentially
      --output_type       Set net output type. Support FP32 and UINT8
      --fp16_high_prec    FP16 high precision. 0(default): not use fp16 high precision; 1: use fp16 high precision

分享:

    相关文档

    相关产品