MASKRCNN(之二)编译和错误解决

  • Post author:
  • Post category:其他


1.Gotoblas下载 和编译

https://www.tacc.utexas.edu/research-development/tacc-software/gotoblas2

建立虚拟环境

安装tensorflow最新版本 pip3 install tensorflow-gpu

安装scipy pip3 install scipy

编译方法1../quickbuild.64bit

编译方法2:reset;make BINARY=64 TARGET=NEHALEM


錯誤1:

libpthread找不到,软连一下

sudo ln -s   /lib/x86_64-linux-gnu/libpthread.so.0  /lib/


錯誤2:

make[1]: Entering directory '/localrepo/RCNN/GotoBLAS2/exports'
perl ./gensymbol linux x86_64 _ 1 0 > linux.def
perl ./gensymbol linktest  x86_64 _ 1 0 > linktest.c
gcc -O2 -DEXPRECISION -m128bit-long-double -Wall -m64 -DF_INTERFACE_GFORT -fPIC  -DSMP_SERVER -DMAX_CPU_NUMBER=8 -DASMNAME= -DASMFNAME=_ -DNAME=_ -DCNAME= -DCHAR_NAME=\"_\" -DCHAR_CNAME=\"\" -I.. -shared -o ../libgoto2_nehalemp-r1.13.so \
-Wl,--whole-archive ../libgoto2_nehalemp-r1.13.a -Wl,--no-whole-archive \
-Wl,--retain-symbols-file=linux.def -lm -lpthread -lm -lpthread
gcc -O2 -DEXPRECISION -m128bit-long-double -Wall -m64 -DF_INTERFACE_GFORT -fPIC  -DSMP_SERVER -DMAX_CPU_NUMBER=8 -DASMNAME= -DASMFNAME=_ -DNAME=_ -DCNAME= -DCHAR_NAME=\"_\" -DCHAR_CNAME=\"\" -I.. -w -o linktest linktest.c ../libgoto2_nehalemp-r1.13.so -L/usr/lib/gcc/x86_64-linux-gnu/5 -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/5/../../..  -l -l -lgfortran -lm -lquadmath -lm -lc   && echo OK.
/usr/bin/ld: cannot find -l-l
collect2: error: ld returned 1 exit status
Makefile:100: recipe for target '../libgoto2_nehalemp-r1.13.so' failed

/usr/bin/ld: cannot find -l-l , 这个是读Makfile.conf里的,而conf是Makefile.system生成的,将对应的注释掉

# Generating Makefile.conf and config.h
#DUMMY := $(shell $(MAKE) -C $(TOPDIR) -f Makefile.getarch CC="$(CC)" FC="$(FC)" HOSTCC="$(HOSTCC)" CFLAGS=$(GETARCH_FLAGS) BINARY=$(BINARY) USE_OPENMP=$(USE_OPENMP) TARGET_CORE=$(TARGET_CORE) all)

Makefile里对应删除也注释掉

@rm -f config.h Makefile_kernel.conf config_kernel.h st* *.dylib # Makefile.conf

Makfile.conf里对应-l -l去掉,这样绕过了问题,


错误3:

../kernel/x86_64/gemm_ncopy_4.S:192: Error: undefined symbol`RPREFETCHSIZE' in operation ../kernel/x86_64/gemm_ncopy_4.S:193:Error: undefined symbol `RPREFETCHSIZE' in operation../kernel/x86_64/gemm_ncopy_4.S:194: Error: undefined symbol`RPREFETCHSIZE' in operation ../kernel/x86_64/gemm_ncopy_4.S:195:Error: undefined symbol `RPREFETCHSIZE' in operation

那么make clean;make BINARY=64 TARGET=NEHALEM;make

最后编译成功如下:

 GotoBLAS build complete.

  OS               ... Linux             
  Architecture     ... x86_64               
  BINARY           ... 64bit                 
  C compiler       ... GCC  (command line : gcc)
  Fortran compiler ... GFORTRAN  (command line : gfortran)
  Library Name     ... libgoto2_nehalemp-r1.13.a (Multi threaded; Max num-threads is 8)

但是根本原因应该是缺少对应库,后期继续研究


2.MaskRCNN 遇到的一些问题


错误1:缺少 一些库

安装pip3 install matplotlib

pip3 install Keras

sudo apt-get install python3-tk


错误2: 找不到文件

出现找不到Python.h,sudo apt-get install python3-dev


错误3:出现

:No module named ‘pycocotools’


git clone https://github.com/pdollar/coco.git
cd coco/PythonAPI
make
make install
python setup.py install


错误4:出现 ImportError: No module named ‘h5py’

sudo apt-get install libhdf5-dev
sudo apt-get install python-h5py
sudo pip3 install h5py



版权声明:本文为wlnvgu原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。