安装及运行openface的大坑

来源:互联网 发布:域名购买是永久的吗 编辑:程序博客网 时间:2024/06/07 02:20

安装及运行openface的大坑

我是按照教程:

http://blog.csdn.net/itas109/article/details/50790139

一步一步做的,编译demo的时候遇见了若干蛋疼的错误:

错误1:运行demo中的compare.py程序时报错 /usr/bin/env: ‘python2\r’: No such file or directory

大概是这样,百度+google+stackoverflow都没有,最后才知道,是因为程序在windows下生成的,需要改为unix编码:

dos2unix compare.py

即可


错误2: 运行compare.py 报错 /usr/bin/env: th: No such file or directory

这个错误是因为安装torch时,用的sudo安装的,导致使用torch权限有些问题,采用超级帐号运行程序即可。

错误3:Exception: Unable to load image: ./images/examples/lennon*

如果按照demo中给的命令:./demos/compare.py images/examples/{lennon*,clapton*}会出现如下报错

Traceback (most recent call last):File "./compare.py", line 99, ind = getRep(img1) - getRep(img2)File "./compare.py", line 68, in getRepraise Exception("Unable to load image: {}".format(imgPath))Exception: Unable to load image: ./images/examples/lennon*

两种原因:
1. demo中给出的图片路径是有问题的,检查改为正确路径,若当前路径在openface下,则该为:
./demos/compare.py ./images/examples/{lennon*,clapton*}
2. 路径输入:{lennon*,clapton*} 之间不能有空格,{lennon*, clapton*} 是错误的


最后,截图compare.py 的运行结果:
运行结果

0 0