当前位置:网站首页>安装C3D v1.0
安装C3D v1.0
2022-07-20 21:38:00 【MallocLu】
前言
可能用到的文件或压缩包:
链接:https://pan.baidu.com/s/1vIRxSJHRoBnrnsjczISOPg?pwd=7asr
提取码:7asr
复制这段内容后打开百度网盘手机App,操作更方便哦
下面所有命令均在root权限下执行,若提示权限不足,则在前面加sudo
主要参考教程若网址失效,可以在网盘里看到“主要参考教程网页备份”
本文所介绍的是C3D v1.0,若想使用C3D v1.1,则其和caffe安装的过程一模一样,跟着“个人caffe安装教程”走一遍,然后再安装C3D v1.1即可
安装CUDA&CUDNN
安装CUDA 10.2及对应的CUDNN(参考“主要参考教程”),为了简化操作作者使用了“矩池云平台”:
已经配置好了CUDA和cuDNN,就不用自己配置了。开一个1元/时的环境就够用
安装依赖
apt-get update
apt-get install -y libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev protobuf-compiler
apt-get install --no-install-recommends libboost-all-dev
apt-get install -y libopenblas-dev liblapack-dev libatlas-base-dev libgflags-dev libgoogle-glog-dev liblmdb-dev git cmake build-essential
# 打开环境配置文件
vim ~/.bashrc
# 在打开的文件末尾添加下面两行
export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH
# 使环境配置文件生效
source ~/.bashrc
安装Opencv
将opencv-3.4.10.zip复制到/root目录下
unzip opencv-3.4.10.zip
删除opencv-3.4.10.zip(为了节省空间)
执行下面的命令
# 进入文件夹 cd opencv-3.4.10 # 创建build文件夹 mkdir build # 进入build文件夹 cd build # 编译 cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local .. make # 安装 make install # 查看是否安装成功 成功将输出:3.4.10 pkg-config --modversion opencv
默认Python2
alias python=python2
# 输出python版本为2.?则为成功
python -V
安装boost
将boost_1_72_0.7z复制到/root目录下
apt-get install p7zip-full
7z x boost_1_72_0.7z
删除boost_1_72_0.7z(为了节省空间)
执行下面的命令
# 进入文件夹 cd boost_1_72_0.7z ./bootstrap.sh --with-libraries=all ./b2 ./b2 install
安装C3D
将C3D-master.zip复制到/root目录下
unzip C3D-master.zip
删除C3D-master.zip(为了节省空间)
执行下面的命令
# 进入文件夹 cd C3D-master/C3D-v1.0/python # 安装依赖包 for req in $(cat requirements.txt); do pip install $req; done # 返回上一级目录 cd .. # 复制文件 cp Makefile.config.example Makefile.config
修改文件
1) 修改Makefile.config
CUDA_ARCH := -gencode arch=compute_20,code=sm_20 \ -gencode arch=compute_20,code=sm_21 \ -gencode arch=compute_30,code=sm_30 \ -gencode arch=compute_35,code=sm_35 \ -gencode=arch=compute_50,code=sm_50 \ #-gencode=arch=compute_50,code=compute_50 修改为 CUDA_ARCH := #-gencode arch=compute_20,code=sm_20 \ #-gencode arch=compute_20,code=sm_21 \ #-gencode arch=compute_30,code=sm_30 \ #-gencode arch=compute_35,code=sm_35 \ -gencode=arch=compute_50,code=sm_50 \ -gencode=arch=compute_50,code=compute_50 # OPENCV_VERSION := 3 修改为 OPENCV_VERSION := 3 INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib 修改为 INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/hdf5/serial
2) 修改Makefile
NVCCFLAGS +=-ccbin=$(CXX) -Xcompiler-fPIC $(COMMON_FLAGS) 修改为 NVCCFLAGS += -D_FORCE_INLINES -ccbin=$(CXX) -Xcompiler -fPIC $(COMMON_FLAGS) LIBRARIES := cudart cublas curand \ pthread \ glog protobuf leveldb snappy \ boost_system \ hdf5_hl hdf5 \ opencv_core opencv_highgui opencv_imgproc 修改为 LIBRARIES := cudart cublas curand \ pthread \ glog protobuf leveldb snappy \ boost_system \ hdf5_serial_hl hdf5_serial \ opencv_core opencv_highgui opencv_imgproc
3) 修改/src/caffe/test/test_gradient_check_util.hpp
Dtype scale = std::max( std::max(fabs(computed_gradient), fabs(estimated_gradient)), 1.); 修改为 Dtype scale = std::max( std::max(fabs(computed_gradient), fabs(estimated_gradient)), Dtype(1.));
编译
make all # 可能有错误:recipe for target 'build/examples/mnist/convert_mnist_data.o' failed # 不用管 make test make runtest # 可能有错误,不用管 # Makefile:285: recipe for target 'runtest' failed # make: *** [runtest] Error 127
C3D测试
将文件conv3d_deepnetA_sport1m_iter_1900000复制到C3D-master/C3D-v1.0/examples/c3d_feature_extraction/
sh c3d_sport1m_feature_extraction_frm.sh
出现错误:…/…/build/tools/extract_image_features.bin: error while loading shared libraries: libopencv_core.so.3.4: cannot open shared object file: No such file or directory
解决:在/etc/ld.so.conf.d/下创建OpenCV.conf,内容为/usr/local/lib,然后执行命令sudo ldconfig
sh c3d_sport1m_feature_extraction_frm.sh
执行成功,E0707 14:27:41.620281 36381 extract_image_features.cpp:121] Successfully extracted 16 features!
保存环境
边栏推荐
- 2022山东视力防控大会,中国护眼产品展,济南近视矫正设备展
- 修改标注样式文字填充颜色
- WinForm forms use assembly instantiation and parameter transfer
- Message: no NPM package can be built. Please confirm that the NPM to be built is in the 'miniprogramroot' directory, or configure project config. Packnpmmaof JSON
- i2c client驱动
- Zhaocai meow | jade meow, brother Tai pours ten thousand Liang, a pear flower, a summer rain
- In the future, a new way of tourism, VR traveling without leaving home, embracing poetry and distance
- Dama summary (summary of data management)
- Industrial application of cartoon 3D virtual image production
- Signal integrity (SI) power integrity (PI) learning notes (xxx) power distribution network (II)
猜你喜欢
Industrial application of cartoon 3D virtual image production
In the future, a new way of tourism, VR traveling without leaving home, embracing poetry and distance
Communication mode of PLC
TransUNet: Transformers Make Strong Encoders for Medical Image Segmentation
How to conduct user retention analysis?
Dama Chapter 8 (data integration and interoperability)
Source code, complement and fixed-point number operation
L'ipaylinks, un service d'intégration des paiements transfrontaliers, a remporté le prix 3A Asia de l'actif!
Esp8266 nodemcu - connect WiFi using WiFi manager Library
致测试/开发程序员:爱生活,不加班,苦逼的程序员......
随机推荐
Esp8266 nodemcu - connect WiFi using WiFi manager Library
Wang fried power to create wealth fast! Xiangling giant panda 2.0 power products officially launched
Mohist patrol source code
Swiftui uses spritekit to create rain animation effects (tutorial includes source code)
【STC15控制WS2812 RGB彩灯级联】
Signal integrity (SI) power integrity (PI) learning notes (xxx) power distribution network (II)
The middle-aged crisis in the Internet industry is the watershed of 35 years old
JZ31 栈的压入、弹出序列
JZ32 从上往下打印二叉树
7.2-CM46 合法括号序列判断
JZ33 二叉搜索树的后序遍历序列
I2C client Drive IIO Device Drive
Code implementation of binary tree node number and leaf node number (C language)
Code implementation sequence traversal binary tree (C language)
7.1-WY22 Fibonacci数列
Dama Chapter 7 (data security)
CFile class
Win64 driver kernel programming -30 Enumerating and deleting thread callbacks
I2C adapter driver
Let me introduce you to the partition automatic management of data warehouse