如果对深度学习感兴趣可以加我微信,互相交流(本人是做嵌入式的,但对深度学习感兴趣):15737978512

2017年6月29日更:

关于ive:
海思已经移植好了caffe库,而且提供了将pc训练好的模型转换为可以导入ive中运行的模型方法,具体参考如下文档:
sdk中ive开发包路径:Hi3519 V100R001C01SPC040\01.software\pc\IVE_CLIB\HiIVE_PC_V2.1.0.5.rar\HiIVE_PC_V2.1.0.5\

2017年6月27日更:
关于移植出现问题有网友已解决,
原因:
openblas库移植的有问题,由于3519浮点运算不支持函数的参数直接传递到FPU的寄存器(s0、d0)中(hard模式),而移植的openblas库使用的是hard模式。
解决方法:
3519浮点运算支持softfp模式,对应openblas分支如下,编译即可:
https://github.com/xianyi/OpenBLAS/tree/arm_soft_fp_abi

1.移植环境

  • Ubuntu16.04 + arm-hisiv500-linux-
  • caffe下载地址:https://github.com/BVLC/caffe/releases

2.移植步骤:

  • 修改Makefile
1)LIBRARIES += glog gflags protobuf boost_system boost_filesystem m hdf5_hl hdf5
2)BLAS ?= open
3)COMMON_FLAGS += -mcpu=cortex-a17.cortex-a7 -mfloat-abi=softfp -mfpu=neon-vfpv4 -mno-unaligned-access -fno-aggressive-loop-optimizations
  • 修改Makefile.config
     1)CPU_ONLY := 12)OPENCV_VERSION := 3 #3)CUSTOM_CXX := arm-hisiv500-linux-g++4)BLAS := open5)INCLUDE_DIRS := $(PYTHON_INCLUDE) /opt/hisi-linux/x86-arm/arm-hisiv500-linux/target/usr/local/include /opt/hisi-linux/x86-arm/arm-hisiv500-linux/target/usr/include /usr/local/include96 LIBRARY_DIRS := $(PYTHON_LIB) /opt/hisi-linux/x86-arm/arm-hisiv500-linux/target/usr/local/lib /opt/hisi-linux/x86-arm/arm-hisiv500-linux/target/usr/lib6)#PYTHON_LIB := /usr/lib7)USE_PKG_CONFIG := 1
  • 编译:make all
  • 安装:make test

3.移植问题汇总

  • 问题一描述:
/opt/hisi-linux/x86-arm/arm-hisiv500-linux/target/usr/local/lib/libboost_filesystem.so: warning: the use of OBSOLESCENT `utime' is discouraged, use `utimes'
/opt/hisi-linux/x86-arm/arm-hisiv500-linux/bin/../lib/gcc/arm-hisiv500-linux-uclibcgnueabi/4.9.4/../../../../arm-hisiv500-linux-uclibcgnueabi/bin/ld: warning: ../../lib/libopencv_video.so, needed by /opt/hisi-linux/x86-arm/arm-hisiv500-linux/target/usr/local/lib/libopencv_shape.so, not found (try using -rpath or -rpath-link)
/opt/hisi-linux/x86-arm/arm-hisiv500-linux/bin/../lib/gcc/arm-hisiv500-linux-uclibcgnueabi/4.9.4/../../../../arm-hisiv500-linux-uclibcgnueabi/bin/ld: warning: ../../lib/libopencv_imgproc.so, needed by /opt/hisi-linux/x86-arm/arm-hisiv500-linux/target/usr/local/lib/libopencv_shape.so, not found (try using -rpath or -rpath-link)
/opt/hisi-linux/x86-arm/arm-hisiv500-linux/bin/../lib/gcc/arm-hisiv500-linux-uclibcgnueabi/4.9.4/../../../../arm-hisiv500-linux-uclibcgnueabi/bin/ld: warning: ../../lib/libopencv_core.so, needed by /opt/hisi-linux/x86-arm/arm-hisiv500-linux/target/usr/local/lib/libopencv_shape.so, not found (try using -rpath or -rpath-link)
/opt/hisi-linux/x86-arm/arm-hisiv500-linux/bin/../lib/gcc/arm-hisiv500-linux-uclibcgnueabi/4.9.4/../../../../arm-hisiv500-linux-uclibcgnueabi/bin/ld: warning: ../../lib/libopencv_objdetect.so, needed by /opt/hisi-linux/x86-arm/arm-hisiv500-linux/target/usr/local/lib/libopencv_stitching.so, not found (try using -rpath or -rpath-link)
/opt/hisi-linux/x86-arm/arm-hisiv500-linux/bin/../lib/gcc/arm-hisiv500-linux-uclibcgnueabi/4.9.4/../../../../arm-hisiv500-linux-uclibcgnueabi/bin/ld: warning: ../../lib/libopencv_calib3d.so, needed by /opt/hisi-linux/x86-arm/arm-hisiv500-linux/target/usr/local/lib/libopencv_stitching.so, not found (try using -rpath or -rpath-link)
/opt/hisi-linux/x86-arm/arm-hisiv500-linux/bin/../lib/gcc/arm-hisiv500-linux-uclibcgnueabi/4.9.4/../../../../arm-hisiv500-linux-uclibcgnueabi/bin/ld: warning: ../../lib/libopencv_features2d.so, needed by /opt/hisi-linux/x86-arm/arm-hisiv500-linux/target/usr/local/lib/libopencv_stitching.so, not found (try using -rpath or -rpath-link)
/opt/hisi-linux/x86-arm/arm-hisiv500-linux/bin/../lib/gcc/arm-hisiv500-linux-uclibcgnueabi/4.9.4/../../../../arm-hisiv500-linux-uclibcgnueabi/bin/ld: warning: ../../lib/libopencv_flann.so, needed by /opt/hisi-linux/x86-arm/arm-hisiv500-linux/target/usr/local/lib/libopencv_stitching.so, not found (try using -rpath or -rpath-link)
/opt/hisi-linux/x86-arm/arm-hisiv500-linux/bin/../lib/gcc/arm-hisiv500-linux-uclibcgnueabi/4.9.4/../../../../arm-hisiv500-linux-uclibcgnueabi/bin/ld: warning: ../../lib/libopencv_ml.so, needed by /opt/hisi-linux/x86-arm/arm-hisiv500-linux/target/usr/local/lib/libopencv_stitching.so, not found (try using -rpath or -rpath-link)
/opt/hisi-linux/x86-arm/arm-hisiv500-linux/bin/../lib/gcc/arm-hisiv500-linux-uclibcgnueabi/4.9.4/../../../../arm-hisiv500-linux-uclibcgnueabi/bin/ld: warning: ../../lib/libopencv_highgui.so, needed by /opt/hisi-linux/x86-arm/arm-hisiv500-linux/target/usr/local/lib/libopencv_stitching.so, not found (try using -rpath or -rpath-link)
/opt/hisi-linux/x86-arm/arm-hisiv500-linux/bin/../lib/gcc/arm-hisiv500-linux-uclibcgnueabi/4.9.4/../../../../arm-hisiv500-linux-uclibcgnueabi/bin/ld: warning: ../../lib/libopencv_videoio.so, needed by /opt/hisi-linux/x86-arm/arm-hisiv500-linux/target/usr/local/lib/libopencv_stitching.so, not found (try using -rpath or -rpath-link)
/opt/hisi-linux/x86-arm/arm-hisiv500-linux/bin/../lib/gcc/arm-hisiv500-linux-uclibcgnueabi/4.9.4/../../../../arm-hisiv500-linux-uclibcgnueabi/bin/ld: warning: ../../lib/libopencv_imgcodecs.so, needed by /opt/hisi-linux/x86-arm/arm-hisiv500-linux/target/usr/local/lib/libopencv_stitching.so, not found (try using -rpath or -rpath-link)
/opt/hisi-linux/x86-arm/arm-hisiv500-linux/bin/../lib/gcc/arm-hisiv500-linux-uclibcgnueabi/4.9.4/../../../../arm-hisiv500-linux-uclibcgnueabi/bin/ld: warning: ../../lib/libopencv_photo.so, needed by /opt/hisi-linux/x86-arm/arm-hisiv500-linux/target/usr/local/lib/libopencv_videostab.so, not found (try using -rpath or -rpath-link)
CXX tools/convert_imageset.cpp
CXX/LD -o .build_release/tools/convert_imageset.bin
  • 问题原因:链接的问题
shunzhi@ubuntu:/opt/hisi-linux/x86-arm/arm-hisiv500-linux/target/usr/local/lib$ arm-hisiv500-linux-readelf -d libopencv_shape.so
Dynamic section at offset 0x2f7c0 contains 30 entries:Tag        Type                         Name/Value0x00000001 (NEEDED)                     Shared library: [../../lib/libopencv_video.so]0x00000001 (NEEDED)                     Shared library: [../../lib/libopencv_imgproc.so]0x00000001 (NEEDED)                     Shared library: [../../lib/libopencv_core.so]0x00000001 (NEEDED)                     Shared library: [libstdc++.so.6]0x00000001 (NEEDED)                     Shared library: [libm.so.0]0x00000001 (NEEDED)                     Shared library: [libgcc_s.so.1]0x00000001 (NEEDED)                     Shared library: [libc.so.0]0x0000000c (INIT)                       0x37a80x0000000d (FINI)                       0x2b3880x00000019 (INIT_ARRAY)                 0x3f0000x0000001b (INIT_ARRAYSZ)               32 (bytes)0x0000001a (FINI_ARRAY)                 0x3f0200x0000001c (FINI_ARRAYSZ)               4 (bytes)0x00000004 (HASH)                       0xd40x00000005 (STRTAB)                     0x10bc0x00000006 (SYMTAB)                     0x5ac0x0000000a (STRSZ)                      5274 (bytes)0x0000000b (SYMENT)                     16 (bytes)0x00000003 (PLTGOT)                     0x3f8d00x00000002 (PLTRELSZ)                   872 (bytes)0x00000014 (PLTREL)                     REL0x00000017 (JMPREL)                     0x34400x00000011 (REL)                        0x26d80x00000012 (RELSZ)                      3432 (bytes)0x00000013 (RELENT)                     8 (bytes)0x6ffffffe (VERNEED)                    0x26b80x6fffffff (VERNEEDNUM)                 10x6ffffff0 (VERSYM)                     0x25560x6ffffffa (RELCOUNT)                   2340x00000000 (NULL)                       0x0
  • 解决方案:

    • 在当前opencv库的位置新建一个相对路径的lib库
      mkdir ../../lib
      cp libopencv* ../../lib
  • 问题二描述:

CXX/LD -o .build_release/test/test_all.testbin src/caffe/test/test_caffe_main.cpp
/opt/hisi-linux/x86-arm/arm-hisiv500-linux/target/usr/local/lib/libboost_filesystem.so: warning: the use of OBSOLESCENT `utime' is discouraged, use `utimes'
/opt/hisi-linux/x86-arm/arm-hisiv500-linux/bin/../lib/gcc/arm-hisiv500-linux-uclibcgnueabi/4.9.4/../../../../arm-hisiv500-linux-uclibcgnueabi/bin/ld: /opt/hisi-linux/x86-arm/arm-hisiv500-linux/bin/../target/lib/libpthread.so.0: undefined reference to symbol 'dlclose'
/opt/hisi-linux/x86-arm/arm-hisiv500-linux/bin/../target/lib/libdl.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Makefile:606: recipe for target '.build_release/test/test_all.testbin' failed
make: *** [.build_release/test/test_all.testbin] Error 1
  • 原因:缺少ptread,dl,rt库

  • 解决方案:Makefile中添加这三个库。

183 LIBRARIES += glog gflags protobuf boost_system boost_filesystem m  hdf5_hl hdf5 pthread dl rt
  • 问题三描述:训练mnist模型时出现的错误。(未解决)
I0406 10:54:27.313168   722 net.cpp:242] This network produces output accuracy
I0406 10:54:27.313230   722 net.cpp:242] This network produces output loss
I0406 10:54:27.313371   722 net.cpp:255] Network initialization done.
I0406 10:54:27.314100   722 solver.cpp:56] Solver scaffolding done.
I0406 10:54:27.314471   722 caffe.cpp:248] Starting Optimization
I0406 10:54:27.314553   722 solver.cpp:273] Solving LeNet
I0406 10:54:27.314610   722 solver.cpp:274] Learning Rate Policy: inv
I0406 10:54:27.321142   722 solver.cpp:331] Iteration 0, Testing net (#0)
*** Aborted at 1491504867 (unix time) try "date -d @1491504867" if you are using GNU date ***
PC: @ 0xb6ea7c54 (unknown)
Segmentation fault

目前caffe和其依赖库已经移植完成,但是在训练数据时出现了错误(运行训练好的模型执行时也会出现这种问题),不知道是否由于依赖库的移植有问题,如果有遇到这种问题欢迎交流(shunzhi163@163.com)。

  • 注意:

    • 也可以在pc训练,在板子上跑模型;但是跑模型时同样会有上述错误。

移植caffe到hi3519相关推荐

  1. Caffe移植(上)--ubuntu16.04+anaconda2+dlib+opencv2+caffe(CPU)+openblas+qt4.8+pycharm

    写在前面: (1):ARM开发板CPU:Exynos 4412,8GDRAM (2):官方交叉编译工具链:arm2009q3 (3):目标:移植Caffe的无CPU版本 (4):arm2009q3编译 ...

  2. 【caffe-Windows】caffe+VS2013+Windows无GPU快速配置教程

    前言 首先来一波地址: happynear大神的第三方caffe:http://blog.csdn.net/happynear/article/details/45372231 Neil Z大神的第三 ...

  3. win10+cpu+caffe搭建

    搭建了几天的caffe,GPU的CPU的都装过了,中途出现了各种问题,觉得值得拿出来记录一下~也方便以后查看~以下是我朋友博客中搭建的过程~写的很好,拿来借用一下~ 前言 首先来一波地址: happy ...

  4. Windows系统下VS2013+caffe的安装

    笔者作为一名深度学习小白,今日开始打算入门caffe框架.而caffe的安装过程没想到出现各种问题,虽参考众多博客,均未完美解决,故集众家所长,贴上一文,希望帮助和我一样的新手.笔者环境为win10+ ...

  5. 研究 | 健康大数据平台的“区块链治理”

    个人健康数据,是一个私密性领域,此类数据的挖掘和应用,以前传统的计算机平台技术方式已经不足以支撑.文章着重探讨了应用区块链技术进行治理的一些方法,但是并没有过多的从区块链"去中心化" ...

  6. yolov2移植到android,darknet(yolov2)移植到caffe框架

    yolov2到caffe的移植主要分两个步骤: 一.cfg,weights转换为prototxt,caffemodel 1.下载源码: git clone https://github.com/mar ...

  7. 【caffe-windows】Linux至Windows平台的caffe移植

    1.前言 主要参考两篇博客以及很多论坛解决细节问题: http://www.cnblogs.com/trantor/p/4570097.html https://initialneil.wordpre ...

  8. 深度学习(五十八)caffe移植至mxnet

    一.模型转换 #**mxnet编译** 1.下载mxnet:git clone https://github.com/dmlc/mxnet.git --recursive 2. 编译mxnet ``` ...

  9. HI3516D之Caffe移植

    编译Glog cd glog-0.3.5 ./configure --host=arm-linux --prefix=/usr/local/HI3516D/v400/glog-0.3.5 CFLAGS ...

最新文章

  1. Google 全球 IP 地址库一览表(更新中)
  2. java Windows7 下环境变量设置
  3. 用python函数画德国国旗代码_python海龟绘图之画国旗实例代码
  4. 百度爬虫爬到虚拟链接 网站被黑_网站地图sitemap对SEO优化有什么作用?
  5. StoreFront web 无法启动指定的应用
  6. Android USB 属性设置:ADB、RNDIS、MTP等
  7. 真正的问题应该在我身上……
  8. python之基础学习day01
  9. python程序可以在任何安装了解释器_Python解释器新手安装教程
  10. 采用MATLAB的DSP调试方法
  11. 角度控制_手机拍剪影,选择拍摄角度,还要控制画面亮度
  12. Linux手动指定ip地址
  13. 浅谈JavaScript--闭包
  14. asp网络编程:Web程序中网页间数据传递方法小结
  15. Vasp学习专题之软件的基本功能和使用
  16. vivado基本知识
  17. 分享《模拟专升本考试排名》
  18. BigDecimal加减乘除计算
  19. 华师大 OJ 3036
  20. 携程旅行网的盈利模式

热门文章

  1. 利用系统相机相册获取单张图片,兼容7.0
  2. 20221127|PMP考前必看|PMP考试通关宝典
  3. 银联开放平台操作指南合辑
  4. 面试薪资谈好1万,邮件却写着“底薪3000+绩效7000”,合理吗?
  5. 【项目总结】锂电池充电器
  6. 《智能时代》读书笔记-可以从中学到什么
  7. 如何删除服务器的文件,服务器上有顽固文件!如何删除?
  8. 利用Python构建股票交易策略 !
  9. linux系统 插优盘安装xvidcap,Linux下的屏幕录制工具XVidCap
  10. 立大仁义,必有大伪诈,立大慈悲,必有大魔