目录

前言

编译工具CMake

C++标准库安装

下载OpenFace代码

OpenCV安装

luarocks—Lua 包管理器,提供一个命令行的方式来管理 Lua 包依赖、安装第三方 Lua 包等功能

安装 TORCH—科学计算框架,支持机器学习算法 

安装依赖的 LUA库 

编译OpenFace代码

下载预训练后的数据

调用Demo测试


前言

Ubuntu18.04+CUDA9.0+cuDNN7.1.3 详细安装教程请参照:https://blog.csdn.net/ctwy291314/article/details/80951148,本文介绍安装opeface相关安装。

编译工具CMake

sudo apt-get install cmake

C++标准库安装

sudo apt-get install libboost-dev
sudo apt-get install libboost-python-dev

下载OpenFace代码

git clone https://github.com/cmusatyalab/openface.git

OpenCV安装

sudo apt-get install libopencv-dev
sudo apt-get install python-opencv

luarocks—Lua 包管理器,提供一个命令行的方式来管理 Lua 包依赖、安装第三方 Lua 包等功能

sudo apt-get install luarocks

安装 TORCH—科学计算框架,支持机器学习算法 

git clone https://github.com/torch/distro.git ~/torch --recursive
cd torch
bash install-deps
./install.sh

安装过程中可能出现以下异常:

cuda 9.0 "error: more than one operator "==" matches these operands"

完整异常信息:

/home/hylink/torch/extra/cutorch/lib/THC/generic/THCTensorMath.cu(393): error: more than one operator "==" matches these operands:
function "operator==(const __half &, const __half &)"
function "operator==(half, half)"
operand types are: half == half /home/hylink/torch/extra/cutorch/lib/THC/generic/THCTensorMath.cu(414): error: more than one operator "==" matches these operands:
function "operator==(const __half &, const __half &)"
function "operator==(half, half)"
operand types are: half == half 2 errors detected in the compilation of "/tmp/tmpxft_00006aee_00000000-6_THCTensorMath.cpp1.ii".
CMake Error at THC_generated_THCTensorMath.cu.o.cmake:267 (message):
Error generating file
/home/hylink/torch/extra/cutorch/build/lib/THC/CMakeFiles/THC.dir//./THC_generated_THCTensorMath.cu.o lib/THC/CMakeFiles/THC.dir/build.make:2939: recipe for target 'lib/THC/CMakeFiles/THC.dir/THC_generated_THCTensorMath.cu.o' failed
make[2]: *** [lib/THC/CMakeFiles/THC.dir/THC_generated_THCTensorMath.cu.o] Error 1
CMakeFiles/Makefile2:172: recipe for target 'lib/THC/CMakeFiles/THC.dir/all' failed
make[1]: *** [lib/THC/CMakeFiles/THC.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2 Error: Build error: Failed building.

原因是cuda和torch的头文件都提供了相同的重载运算符,编译器不知道用哪一个。输入下面shell命令禁止使用cuda的头文件编译torch即可:

export TORCH_NVCC_FLAGS="-D__CUDA_NO_HALF_OPERATORS__"

重新运行

./install.sh

重新开始编译就OK了,安装过程中它会提示是否把torch加入bashrc中,有”….(yes|no)”提示,输入yes,即可。

编译成功过后,输入命令

source ~/.bashrc

使torch立即生效

输入th进行验证是否安装成功

安装依赖的 LUA库 

luarocks install dpnn

注:cunn使用了cuda,如果不使用GPU来跑的话,不需要安装这个;fblualib和torchx都是用来训练DNN的,建议安装。

luarocks install dpnn
luarocks install nn
luarocks install optim
luarocks install csvigo
luarocks install cunn
luarocks install fblualib
luarocks install torchx

编译OpenFace代码

python setup.py build
sudo python setup.py install

下载预训练后的数据

sh models/get-models.sh

调用Demo测试

cd openface
python demos/compare.py images/examples/{lennon-1.jpg,lennon-2.jpg}

官方文档:

http://cmusatyalab.github.io/openface/demo-1-web/

http://cmusatyalab.github.io/openface/setup/

Ubuntu18.04+CUDA9.0+cuDNN7.1.3+openface安装总结的更多相关文章

  1. Ubuntu18.04 + CUDA9.0 + cuDNN7.3 + Tensorflow-gpu-1.12 + Jupyter Notebook深度学习环境配置

    目录 一.Ubuntu18.04 LTS系统的安装 1. 安装文件下载 2. 制作U盘安装镜像文件 3. 开始安装 二.设置软件源的国内镜像 1. 设置方法 2.关于ubuntu镜像的小知识 三.Nv ...

  2. Ubuntu18.04+CUDA9.0+cuDNN7.1.3+TensorFlow1.8 安装总结

    Ubuntu18.04发行已经有一段时间了,正好最近Tensorflow也发布了1.8版本,于是决定两个一起装上,以下是安装总结,大致可 以分为5个步骤 确认当前软件和硬件环境.版本 更新显卡驱动,软 ...

  3. Ubuntu16.04 + cuda9.0 + cudnn7.1.4 + tensorflow安装

    安装前的准备 UEFI 启动GPT分区 Win10和Ubuntu16.04双系统安装 ubuntu16.04 NVIDIA 驱动安装 ubuntu16.04 NVIDIA CUDA8.0 以及cuDN ...

  4. Ubuntu18.04 + cuda9.0+cudnn7.0

    1 cannot find Toolkit in /usr/local/cuda-8.0 2017年05月27日 17:37:33 阅读数:2754  对于新版本ubuntukylin17.04安装C ...

  5. y7000笔记本 darknet-yolo安装与测试(Ubuntu18.04+Cuda9.0+Cudnn7.1)

    环境配置看上一贴 https://www.cnblogs.com/clemente/p/10386479.html 1 安装darknet 1-1 克隆darknet repo git clone h ...

  6. ubuntu18.04+ cuda9.0+opencv3.1+caffe-ssd安装

    详细Ubuntu18.04,CUDA9.0,OpenCV3.1,Tensorflow完全配置指南 问题1:使用Cmake编译opencv源码 CMake Error: The following va ...

  7. ubuntun16.04+cuda9.0+cudnn7+anaconda3+pytorch+anaconda3下py2安装pytorch

    一.电脑配置 说明: 电脑配置: LEGION笔记本CPU Inter Core i7 8代GPU NVIDIA GeForce GTX1060Windows10 所需的环境: Anaconda3(6 ...

  8. Ubuntu16.04 + cuda9.0 +cudnn7.1(转载)

    转载一个详细可用的ubuntu16.04+cuda9.0+cudnn7.1教程. 0 - 参考材料 https://blog.csdn.net/Umi_you/article/details/8026 ...

  9. Ubuntu16.04 + CUDA9.0 + cuDNN7.3 + Tensorflow-gpu-1.12 + Jupyter Notebook 深度学习环境配置

    目录 一.Ubuntu16.04 LTS系统的安装 二.设置软件源的国内镜像 1. 设置方法 2.关于ubuntu镜像的小知识 三.Nvidia显卡驱动的安装 1. 首先查看显卡型号和推荐的显卡驱动 ...

随机推荐

  1. NVIDIA Jetson™ TX1 Module

    NVIDIA® Jetson TX1 是一台模块式计算机,代表了视觉计算领域近20年的研发成就,其尺寸仅有信用卡大小.Jetson TX1 基于NVIDIA Maxwell™ 架构,配有256个 NV ...

  2. python断言语句assert

    断言语句的格式 assert test, [msg] test是一个表达式,表达式求值为Fals时引发AssertionError异常,msg是可选的异常消息. def test_assert(a): ...

  3. 八皇后问题 -- python面向对象解法

    # [8*8棋盘八皇后问题] class Queen: def __init__(self, row, col): self.row = row self.col = col self.pos = ( ...

  4. python如何简单的处理图片(1):打开\显示

    一提到数字图像处理,可能大多数人就会想到matlab,但matlab也有自身的缺点: 1.不开源,价格贵 2.软件容量大.一般3G以上,高版本甚至达5G以上. 3.只能做研究,不易转化成软件. 因此, ...

  5. java访问ftp

    1.连接ftp FTPClient ftpClient = new FTPClient(); ftpClient.connect(host,port); ftpClient.login(userNam ...

  6. AI比医生更好地发现皮肤癌,未来计算机技术可渗透医院

    未来机器人将取代医生?这可能是事实.为什么这么多年轻人选择计算机行业,因为这是一个趋势.据法新社报道,研究人员周二称,一项计算机技术比人类皮肤科医生在检测皮肤癌方面的表现要好得多,因为这项研究是为了寻 ...

  7. Scene Text Detection(场景文本检测)论文思路总结

    任意角度的场景文本检测论文思路总结共同点:重新添加分支的创新更突出场景文本检测基于分割的检测方法 spcnet(mask_rcnn+tcm+rescore) psenet(渐进扩展) mask tex ...

  8. 人生苦短_我用Python_Try_Exception异常捕捉_007

    # coding=utf-8 ''' request+try__异常处理 ''' import requests class HttpRequests: def __init__(self, url, ...

  9. Debian取消从光盘安装软件的方式(please insert the disc labeled)

    与Ubuntu不同,使用apt-get install packages时Debian可能会提示: Media change: please insert the disc labeled 'Debi ...

  10. vagrant(二)配置文件vagrantfile详解 以及安装php、nginx、mysql

    上一篇文章完整的讲叙了如何安装一个vagrant的环境.这里主要说一说vagrant的配置文件Vagrantfile. 一 配置详解 在我们的开发目录下有一个文件Vagrantfile,里面包含有大量 ...