运行teradeep演示时遇到两个不同的错误,libthnets.so文件丢失

我正在尝试安装teradeep/demo-apps 进行实验,但遇到了阻碍。

解压缩后,我看到了三个文件夹:opencvgeneric-pcgeneric-embedded。编译了两个generic文件夹之后,我尝试运行这三个,但三个都失败了。

当我尝试运行 generic-pc 时,出现以下错误:

使用的线程数:8
qlua:./frame.lua:63:module 'linuxcamera' not found:
    no field package.preload['linuxcamera']
    no file '/home/dave/.luarocks/share/lua/5.1/linuxcamera.lua'
    no file '/home/dave/.luarocks/share/lua/5.1/linuxcamera/init.lua'
    no file '/home/dave/torch/install/share/lua/5.1/linuxcamera.lua'
    no file '/home/dave/torch/install/share/lua/5.1/linuxcamera/init.lua'
    no file './linuxcamera.lua'
    no file '/home/dave/torch/install/share/luajit-2.1.0-alpha/linuxcamera.lua'
    no file '/usr/local/share/lua/5.1/linuxcamera.lua'
    no file '/usr/local/share/lua/5.1/linuxcamera/init.lua'
    no file '/home/dave/.luarocks/lib/lua/5.1/linuxcamera.so'
    no file '/home/dave/torch/install/lib/lua/5.1/linuxcamera.so'
    no file './linuxcamera.so'
    no file '/usr/local/lib/lua/5.1/linuxcamera.so'
    no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
    [C]: at 0x7fcb5d5a1970
    [C]: in function 'require'
    ./frame.lua:63: in function 'prep_lua_linuxcamera'
    ./frame.lua:86: in function 'init'
    run.lua:102: in main chunk

当我尝试运行opencvgeneric-embedded文件夹时,出现以下错误:

: error while loading shared libraries: libthnets.so: cannot open shared object file: No such file or directory

最好的解决方法是什么?

点赞
用户1439597
用户1439597

为了让演示应用在linux上正常工作,需要一个特殊编译的库linuxcamera,该库是随演示应用一起提供的。您需要将其编译并存储在目录/home/dave/torch/install/lib/lua/5.1/下。

首先,进入generic-pc文件夹的lib子文件夹,并编辑Makefile文件,使它看起来像这样(您可以直接复制并替换,只需更改到库文件夹的路径即可):

UNAME_S := $(shell uname -s)
UNAME_P := $(shell uname -p)
LBITS := $(shell getconf LONG_BIT)

INCLUDE = -I. -I/usr/local/include -I$(HOME)/torch/install/include
LIBOPTS = -shared -L$(HOME)/torch/install/lib/lua/5.1 -L$(HOME)/torch/install/lib
CFLAGS = -O3 -c -fpic -Wall
LINUXCAMERA_FILES = linuxcamera.o videocap.o
LIBFILES = linuxcamera.so
CC = gcc

ifneq ($(filter arm%,$(UNAME_P)),)
    CFLAGS += -mfpu=neon
endif

.PHONY : all
all : $(LIBFILES)

.c.o:
    $(CC) $(CFLAGS) $(INCLUDE) $<

linuxcamera.so : $(LINUXCAMERA_FILES)
    $(CC) $(LINUXCAMERA_FILES) $(LIBOPTS) -o $@

install : $(LIBFILES)
    sudo cp $(LIBFILES) $(HOME)/torch/install/lib/lua/5.1/

uninstall :
    sudo rm $(HOME)/torch/install/lib/lua/5.1/linuxcamera.so

.PHONY : clean
clean :
    rm -f *.o $(LIBFILES)

然后,如文档所述,运行make clean; make; make install;

这应该会为您的qlua运行时编译和复制lib文件夹中的库文件。现在,您应该能够运行qlua run.lua,并且它应该正确加载库。

2016-05-10 04:11:14