- 收藏
- 点赞
- 分享
- 举报
深度学习框架caffe移植到3519的过程
[i=s] 本帖最后由 liusir 于 2017-6-29 21:37 编辑 [/i]
2017年6月29日更:
[color=Green] 关于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\ [/url][/color]
2017年6月27日更:
[color=Red]关于移植出现问题有网友已解决, 原因: openblas库移植的有问题,由于3519浮点运算不支持函数的参数直接传递到FPU的寄存器(s0、d0)中(hard模式),而移植的openblas库使用的是hard模式。
解决方法: 3519浮点运算支持softfp模式,对应openblas分支如下,编译即可: https://github.com/xianyi/OpenBLAS/tree/arm_soft_fp_abi[/color]
1.以下是caffe依赖库gflags,lmdb,protobuf,leveldb,snappy,hdf5,boost,openblas移植以及caffe的编译过程。
2.caffe依赖库opencv和glog的移植可参考我之前发的帖子。
3.目前caffe和其依赖库已经移植完成,但是在训练数据时出现了错误(运行PC训练好的模型时也会出现这种错误),不知道是否由于依赖库的移植有问题,如果有遇到这种问题或者对该问题有什么想法的欢迎交流([email]shunzhi163@163.com[/email])。
错误log:
[code]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[/code]
[b]一.移植gflags[/b]
1.移植环境
* Ubuntu16.04 + arm-hisiv500-linux-gcc
* gflags下载地址:https://github.com/schuhschuh/gflags/archive/master.zip
2.编译步骤
* 解压:shunzhi@ubuntu:~/software/gflags$ unzip master.zip
* 新建安装编译目录:shunzhi@ubuntu:~/software/gflags/gflags-master$ mkdir _install _build
* 配置:shunzhi@ubuntu:~/software/gflags/gflags-master/_build$ cmake-gui
点击Browse Source选择~/software/gflags/gflags-master 点击Browse Build选择~/software/gflags/gflags-master/_build
点击Configure
此时出现的对话框选择最后一项:Specify options for cross-compiling
点击NEXT
Operating System填写 arm-hisiv500-linux
C填写arm-hisiv500-linux-gcc
C++填写arm-hisiv500-linux-g++
点击finish,然后等待Configuration done
然后在出现的列表中修改CMAKE_INSTALL_PREFIX为~/software/gflags/gflags-master/_install
点击Generate
等待Generation done
之后关闭cmake软件。
* 编译:shunzhi@ubuntu:~/software/gflags/gflags-master/_build$ make
* 安装:shunzhi@ubuntu:~/software/gflags/gflags-master/_build$ sudo make install
3.编译结果:
[code]shunzhi@ubuntu:~/software/gflags/gflags-master/_install$ tree . ├── include │ └── gflags │ ├── gflags_completions.h │ ├── gflags_declare.h │ ├── gflags_gflags.h │ └── gflags.h └── lib ├── cmake │ └── gflags │ ├── gflags-config.cmake │ ├── gflags-config-version.cmake │ ├── gflags-targets.cmake │ └── gflags-targets-release.cmake ├── libgflags.a ├── libgflags_nothreads.a └── pkgconfig └── gflags.pc
6 directories, 11 files[/code]
[b]二.移植lmdb[/b]
1.移植环境
* Ubuntu16.04 + arm-hisiv500-linux-gcc
* lmdb下载地址:https://github.com/LMDB/lmdb/releases
2.编译步骤
* 修改makefile
[code] 21 #CC = gcc
22 CC = arm-hisiv500-linux-gcc
23 #AR = ar
24 AR = arm-hisiv500-linux-ar
26 THREADS = -lpthread
32 prefix = /home/shunzhi/software/lmdb/libraries/liblmdb/install[/code]
* 新建安装目录:mkdir _install
* 编译: make
* 安装: sudo make install
3.编译结果:
[code]shunzhi@ubuntu:~/software/lmdb/lmdb-LMDB_0.9.19/libraries/liblmdb/install$ tree . ├── bin │ ├── mdb_copy │ ├── mdb_dump │ ├── mdb_load │ └── mdb_stat ├── include │ └── lmdb.h ├── lib │ ├── liblmdb.a │ └── liblmdb.so └── share └── man └── man1 ├── mdb_copy.1 ├── mdb_dump.1 ├── mdb_load.1 └── mdb_stat.1
6 directories, 11 files[/code]
[b]三.移植protobuf[/b]
1.编译环境:
* Ubuntu16.04 + arm-hisiv500-linux-
* protobuf3.20下载地址:https://github.com/google/protobuf/tags
2.移植到3519:
1)编译步骤:
* 生成配置文件:autoconf.sh
* 配置:./configure --build=i686-pc-linux --host=arm-hisiv500-linux CC=arm-hisiv500-linux-gcc CXX=arm-hisiv500-linux-g++ --with-protoc=../../protobuf/protobuf-3.2.0/src/protoc --prefix=/home/shunzhi/software/protobuf/hi_proto/protobuf-3.2.0/install
* 编译:make
* 检测:make check # 检测会出现错误,不用管他( If "make check" fails, you can still install, but it is likely that some features of this library will not work correctly on your system. Proceed at your own risk.)
* 安装:make install
2)配置参数解释:
* --build:指明执行编译的平台为64位x86的Linux平台。
* --host :指明运行的平台。
* CC :gcc交叉编译工具。
* CXX :c++交叉编译工具。
* --prefix:安装目录。
* --with-protoc:指明protoc的查找路径,当我们在pc机上进行交叉编译时,src目录下protoc可能会无法执行,所以我们必须要编译一个protoc可执行文件,将其拷贝到src目录或者执行用这个配置参数来指明protoc的路径;上述参数就是指明protoc路径为我之前在pc编译protobuf时生成的protoc。
[b]四.移植leveldb:[/b]
1.编译环境
* Ubuntu16.4 + arm-hisiv500-linux-
* leveldb 下载地址:https://github.com/google/leveldb/releases
2.移植步骤:
* 修改build_detect_platform文件:
添加海思编译工具
[code]CC=arm-hisiv500-linux-gcc if test -z "$CC"; then CC=gcc fi
CXX=arm-hisiv500-linux-g++ if test -z "$CXX"; then CXX=g++ fi[/code]
* 修改db/db_iter.h文件
在#endif前添加如下一行
typedef int ssize_t; 如果不定义会出现如下错误:
[code]arm-hisiv500-linux-g++ -I. -I./include -std=c++0x -fno-builtin-memcmp -lpthread -DOS_LINUX -DLEVELDB_PLATFORM_POSIX -DLEVELDB_ATOMIC_PRESENT -O2 -DNDEBUG -fPIC -c db/db_iter.cc -o out-shared/db/db_iter.o db/db_iter.cc:107:3: error: ‘ssize_t’ does not name a type ssize_t RandomPeriod() { ^ db/db_iter.cc:123:3: error: ‘ssize_t’ does not name a type ssize_t bytescounter; ^ db/db_iter.cc: In constructor ‘leveldb::{anonymous}::DBIter::DBIter(leveldb::DBImpl, const leveldb::Comparator, leveldb::Iterator, leveldb::SequenceNumber, uint32_t)’: db/db_iter.cc:60:9: error: class ‘leveldb::{anonymous}::DBIter’ does not have any field named ‘bytescounter’ bytescounter(RandomPeriod()) { ^ db/db_iter.cc:60:37: error: ‘RandomPeriod’ was not declared in this scope bytescounter(RandomPeriod()) { ^ db/db_iter.cc: In member function ‘bool leveldb::{anonymous}::DBIter::ParseKey(leveldb::ParsedInternalKey)’: db/db_iter.cc:132:3: error: ‘ssize_t’ was not declared in this scope ssizet n = k.size() + iter->value().size(); ^ db/db_iter.cc:133:3: error: ‘bytescounter’ was not declared in this scope bytescounter -= n; ^ db/db_iter.cc:133:21: error: ‘n’ was not declared in this scope bytescounter -= n; ^ db/db_iter.cc:135:36: error: ‘RandomPeriod’ was not declared in this scope bytescounter += RandomPeriod(); ^ Makefile:415: recipe for target 'out-shared/db/db_iter.o' failed make: *** [out-shared/db/db_iter.o] Error 1[/code]
* 编译:make
* 编译后生成的库和头文件在如下目录:
out-shared out-static include
[b]五.snappy移植[/b] 1.编译环境:
* Ubuntu16.04 + arm-hisiv500-linux-
* snappy-1.1.4下载地址:https://github.com/google/snappy/releases
2.移植到3519:
1)编译步骤:
* 生成配置文件:autoconf.sh
* 配置:./configure --build=i686-pc-linux --host=arm-hisiv500-linux CC=arm-hisiv500-linux-gcc CXX=arm-hisiv500-linux-g++ --prefix=/home/shunzhi/software/snappy/snappy-1.1.4/install
* 编译:make
* 检测:make check # 检测会出现错误,不用管他( If "make check" fails, you can still install, but it is likely that some features of this library will not work correctly on your system. Proceed at your own risk.)
* 安装:make install
2)移植结果:
[code]shunzhi@ubuntu:~/software/snappy/snappy-1.1.4/install$ tree . ├── include │ ├── snappy-c.h │ ├── snappy.h │ ├── snappy-sinksource.h │ └── snappy-stubs-public.h ├── lib │ ├── libsnappy.a │ ├── libsnappy.la │ ├── libsnappy.so -> libsnappy.so.1.3.1 │ ├── libsnappy.so.1 -> libsnappy.so.1.3.1 │ ├── libsnappy.so.1.3.1 │ └── pkgconfig │ └── snappy.pc └── share └── doc └── snappy ├── ChangeLog ├── COPYING ├── format_description.txt ├── framing_format.txt ├── INSTALL ├── NEWS └── README
6 directories, 17 files[/code]
[b]六.hdf5移植[/b] 1.编译环境
* Ubuntu16.4 + arm-hisiv500-linux-
* 下载地址:https://support.hdfgroup.org/HDF5/release/obtain518.html
2.移植
* cmake配置:cmake-gui
选择源码路径,编译配置文件路径,编译器,点击configure(其会报错,不用管,再次点击即可),选择安装路径,点击generate
* 参考如下脚本来安装:
1)更改一下交叉编译工具
2)如果ssh工具没有,可以使用telnet,该库的移植需要在宿主机编译,在目标机执行一些初始化的程序,生成一些arm平台的配置文件,然后在继续编译
[code]#!/bin/sh
to cross compile the hdf5 library on arm we need some generated source code
from the target platform.
This script does the following:
1. setup a cmake build
2. try to build with pre generated files (you have to generate them)
Place them in arm_files/generated/${platform}
(relative to the directory you start this script) eg:
#
arm_files/generated/
├── sam9
│ ├── H5lib_settings.c
│ └── H5Tinit.c
└── xilinx
├── H5lib_settings.c
└── H5Tinit.c
2. OR connect via ssh with this script to your arm target and it will
generate the files on the fly
#
preconditions:
-------------
- we need cmake
- we need a cross compiler reachable within $PATH so cmake can detect
- download source code: hdf5-1.8.16.tar.bz2
- extract tarball
- go into extracted tarball and start this script
eg ./build_hdf5.sh generate
OR if you have pregenerated files for H5lib_settings.c and H5Tinit.c
./build_hdf5.sh
##########################################################
g_generate_on_host="192.168.0.6"
g_generate="$1" G_GENERATE_H5DETECT="H5Tinit.c" G_GENERATE_H5MAKE_LIBSETTINGS="H5lib_settings.c" G_INITIAL_DIR="$PWD"
function cmake_tool_chain_helper() { local toolchain="$1" local build_dir="$2"
cat << EOF > $build_dir/${toolchain}.cmake
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR arm)
set(CMAKE_C_COMPILER $toolchain-gcc)
set(CMAKE_CXX_COMPILER $toolchain-g++)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
EOF }
function generate_fake_tools() { echo "#!/bin/sh" > H5detect echo "#!/bin/sh" > H5make_libsettings chmod +x H5detect H5make_libsettings }
function build_for_platform() { local platform="$1" local build_dir="$2" local toolchain="$3" local install_dir="$4"
test -e "$build_dir" || mkdir -p "$build_dir"
cd "$build_dir"
cmake_tool_chain_helper "$toolchain" "$build_dir"
# run 2 times as errors will occur due to not supported cross compiling
# 1st run configure
# 2nd run generate Makefiles
for x in 1 2 ; do
cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE="${build_dir}/${toolchain}.cmake" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="${install_dir}" \
-DBUILD_TESTING=false -DHDF5_BUILD_EXAMPLES=false -DCMAKE_CXX_FLAGS="-D_GNU_SOURCE" -DCMAKE_C_FLAGS="-D_GNU_SOURCE" ..
done
# make: it will fail several time due to plattform depending files to be generated
# we have them allready generated on the arm platform
# so we replace the tools with a fake tools
local path_gen_files="${G_INITIAL_DIR}/arm_files/generated/${platform}"
if [ "$g_generate" == "generate" ] ;then
local dir=/path/on/device/
path_gen_files="/tmp/h5_generated"
test -e "$path_gen_files" || mkdir "$path_gen_files"
for x in bin/H5detect bin/H5make_libsettings H5detect H5make_libsettings; do
test -e "$x" && rm "$x"
done
# try to generate files on host -> this will fail
make
echo "-------------------"
echo "# ---> copy files to target"
echo "-------------------"
scp bin/H5detect bin/H5make_libsettings libhdf5.settings root@${g_generate_on_host}:${dir} || exit 1
echo "-------------------"
echo "# ---> chmod those files"
echo "-------------------"
ssh root@${g_generate_on_host} "cd $dir &> /dev/null ; chmod +x H5detect H5make_libsettings"
echo "-------------------"
echo "# ---> generate "$path_gen_files"/$G_GENERATE_H5DETECT"
echo "-------------------"
ssh root@${g_generate_on_host} "cd $dir &> /dev/null ; ./H5detect" > "$path_gen_files"/$G_GENERATE_H5DETECT
echo "-------------------"
echo "# ---> generate "$path_gen_files"/$G_GENERATE_H5MAKE_LIBSETTINGS"
echo "-------------------"
ssh root@${g_generate_on_host} "cd $dir &> /dev/null ; ./H5make_libsettings" > "$path_gen_files"/$G_GENERATE_H5MAKE_LIBSETTINGS
fi
# below steps needs to be done twice as make tries to generate with arm binary on x86 (H5detect)
# and second for H5make_libsettings
make
generate_fake_tools
cp "$path_gen_files"/$G_GENERATE_H5MAKE_LIBSETTINGS .
cp "$path_gen_files"/$G_GENERATE_H5DETECT .
make
generate_fake_tools
cp "$path_gen_files"/$G_GENERATE_H5MAKE_LIBSETTINGS .
cp "$path_gen_files"/$G_GENERATE_H5DETECT .
# no start the real build
make -j4
make install
}
build_for_platform "xilinx" "$PWD/build_xilinx" "arm-xilinx-linux-gnueabi" "$PWD/install_xilinx"
build_for_platform "sam9" "$PWD/build_sam9" "arm-none-linux-gnueabi" "$PWD/install_sam9"[/code]
[b]七.boost移植[/b]
1.编译环境:
* Ubuntu16.04 + arm-hisiv500-linux-gcc
* 下载地址: http://sourceforge.net/projects/boost/files/boost/
2.移植:
* 解压:
* 新建安装目录:mkdir install
* 运行安装包自带脚本:./bootstrap.sh --prefix=/home/shunzhi/software/boost/boost_1_64_0/install
* 修改project-config.jam文件,具体修改如下:
10 if ! gcc in [ feature.values
* 编译安装:./bjam install toolset=gcc-arm --layout=tagged --build-type=complete --prefix=/home/shunzhi/software/boost/boost_1_63_0/install
3.测试程序:
[code]#include
include<boost/lexical_cast.hpp>
int main()
{
int a = boost::lexical_cast<int>("1008611");
std::cout << a <<std::endl;
return 0;
}[/code]
编译测试程序: arm-hisiv500-linux-g++ boost_test.cpp -L ../stage/lib/ -I ../ -o test
注意:
* option.set prefix :(交叉编译器所在位置);
* option.set exec-prefix :(交叉编译器所在位置)/bin ;
* option.set libdir :(交叉编译器所在位置)/lib ;
* option.set includedir :(交叉编译器所在位置)/include
[b]八.OpenBLAS移植[/b]
1.编译环境:
* Ubuntu16.04 + arm-hisiv500-linux-gcc
* 下载地址: https://github.com/xianyi/OpenBLAS/releases
2.移植步骤:
修改Makefile.arm
[code] 12 ifeq ($(CORE), ARMV7)
13 ifeq ($(OSNAME), Android)
14 CCOMMON_OPT += -marm -mfpu=neon -mfloat-abi=hard -march=armv7-a -Wl,--no-warn-mismatch
15 FCOMMON_OPT += -marm -mfpu=neon -mfloat-abi=hard -march=armv7-a -Wl,--no-warn-mismatch
16 else
17 #CCOMMON_OPT += -marm -mfpu=vfpv3 -mfloat-abi=hard -march=armv7-a
18 #FCOMMON_OPT += -marm -mfpu=vfpv3 -mfloat-abi=hard -march=armv7-a
19 CCOMMON_OPT += -mcpu=cortex-a17.cortex-a7 -mfloat-abi=softfp -mfpu=neon-vfpv4 -mno-unaligned-access -fno-aggressive-loop-optimizations
20 FCOMMON_OPT += -mcpu=cortex-a17.cortex-a7 -mfloat-abi=softfp -mfpu=neon-vfpv4 -mno-unaligned-access -fno-aggressive-loop-optimizations
21 endif
22 endif [/code]
* 解压:
* 编译:make TARGET=ARMV7 HOSTCC=gcc CC=arm-hisiv500-linux-gcc CROSS=1 CROSS_SUFFIX=arm-hisiv500-linux- NO_LAPACKE=1 NO_SHARED=1 BINARY=32 NOFORTRAN=1 libs
* 安装:make PREFIX=/home/shunzhi/software/OpenBLAS-0.2.19/install install
3.移植结果:
[code]shunzhi@ubuntu:~/software/OpenBLAS-0.2.19/install$ tree . ├── bin ├── include │ ├── cblas.h │ ├── f77blas.h │ ├── lapacke_config.h │ ├── lapacke.h │ ├── lapacke_mangling.h │ ├── lapacke_utils.h │ └── openblas_config.h └── lib ├── cmake │ └── openblas ├── libopenblas.a -> libopenblas_armv7p-r0.2.19.a └── libopenblas_armv7p-r0.2.19.a
5 directories, 9 files[/code]
[b]九.caffe的移植[/b]
1.移植环境
* Ubuntu16.04 + arm-hisiv500-linux-
* caffe下载地址:https://github.com/BVLC/caffe/releases
2.移植步骤:
* 修改Makefile
[code]1)LIBRARIES += glog gflags protobuf boost_system boost_filesystem m hdf5_hl hdf5 2)BLAS ?= open 3)LIBRARIES += opencv_core opencv_highgui opencv_imgproc opencv_imgcodecs 4)COMMON_FLAGS += -mcpu=cortex-a17.cortex-a7 -mfloat-abi=softfp -mfpu=neon-vfpv4 -mno-unaligned-access -fno-aggressive-loop-optimizations 5)USE_PKG_CONFIG ?= 1 (解决opencv库链接的问题)[/code]
* 修改Makefile.config
[code] 1)CPU_ONLY := 1 2)OPENCV_VERSION := 3 # 3)CUSTOM_CXX := arm-hisiv500-linux-g++ 4)BLAS := open 5)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/include 96 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/lib 6)#PYTHON_LIB := /usr/lib 7)USE_PKG_CONFIG := 1[/code]
[b]移植问题汇总:[/b]
1.问题描述:
[code]/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[/code]
问题原因:链接的问题
[code]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/Value 0x00000001 (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) 0x37a8 0x0000000d (FINI) 0x2b388 0x00000019 (INIT_ARRAY) 0x3f000 0x0000001b (INIT_ARRAYSZ) 32 (bytes) 0x0000001a (FINI_ARRAY) 0x3f020 0x0000001c (FINI_ARRAYSZ) 4 (bytes) 0x00000004 (HASH) 0xd4 0x00000005 (STRTAB) 0x10bc 0x00000006 (SYMTAB) 0x5ac 0x0000000a (STRSZ) 5274 (bytes) 0x0000000b (SYMENT) 16 (bytes) 0x00000003 (PLTGOT) 0x3f8d0 0x00000002 (PLTRELSZ) 872 (bytes) 0x00000014 (PLTREL) REL 0x00000017 (JMPREL) 0x3440 0x00000011 (REL) 0x26d8 0x00000012 (RELSZ) 3432 (bytes) 0x00000013 (RELENT) 8 (bytes) 0x6ffffffe (VERNEED) 0x26b8 0x6fffffff (VERNEEDNUM) 1 0x6ffffff0 (VERSYM) 0x2556 0x6ffffffa (RELCOUNT) 234 0x00000000 (NULL) 0x0[/code]
解决方案: 在当前opencv库的位置新建一个相对路径的lib库 mkdir ../../lib cp libopencv* ../../lib
2.问题描述:
[code]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[/code]
原因:缺少ptread,dl,rt库
解决方案:Makefile中添加这三个库。 183 LIBRARIES += glog gflags protobuf boost_system boost_filesystem m hdf5_hl-static hdf5-static pthread dl rt
问题描述:训练mnist模型时出现的错误。(未解决)
[code]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[/code] [postbg]bg4.png[/postbg]
Markdown 语法
- 加粗**内容**
- 斜体*内容*
- 删除线~~内容~~
- 引用> 引用内容
- 代码`代码`
- 代码块```编程语言↵代码```
- 链接[链接标题](url)
- 无序列表- 内容
- 有序列表1. 内容
- 缩进内容
- 图片![alt](url)
-
2017-06-05 09:27:37
-
2019-03-14 14:15:44
-
2019-12-20 11:25:26
-
22018-02-02 15:03:02
-
2023-06-06 21:52:36
-
2019-12-18 21:22:30
-
2019-03-15 15:26:44
-
2018-12-12 17:44:13
-
2021-01-27 14:52:26
-
2009-06-26 09:06:02
-
2017-02-24 14:52:47
-
2018-11-18 09:06:31
-
2020-10-31 10:26:55
-
2021-01-06 16:53:59
-
2019-08-19 16:07:25
-
2020-10-29 11:22:39
-
2017-02-22 14:32:22
-
2018-12-11 13:45:29
-
2020-10-31 10:53:07
-
5Hi3516CV610 如何使用SD卡升级固件
-
5cat /dev/logmpp 报错 <3>[ vi] [func]:vi_send_frame_node [line]:99 [info]:vi pic queue is full!
-
50如何获取vpss chn的图像修改后发送至vo
-
5FPGA通过Bt1120传YUV422数据过来,vi接收不到数据——3516dv500
-
50SS928 运行PQtools 拼接 推到设备里有一半画面会异常
-
53536AV100的sample_vdec输出到CVBS显示
-
10海思板子mpp怎么在vi阶段改变视频数据尺寸
-
10HI3559AV100 多摄像头同步模式
-
9海思ss928单路摄像头vio中加入opencv处理并显示
-
10EB-RV1126-BC-191板子运行自己编码的程序
举报类型
- 内容涉黄/赌/毒
- 内容侵权/抄袭
- 政治相关
- 涉嫌广告
- 侮辱谩骂
- 其他
详细说明