Skip to content

Instantly share code, notes, and snippets.

@MaskeZen
Created January 27, 2021 20:31
Show Gist options
  • Save MaskeZen/105d7ee457c43a6ddb155539f48870cb to your computer and use it in GitHub Desktop.
Save MaskeZen/105d7ee457c43a6ddb155539f48870cb to your computer and use it in GitHub Desktop.
notes from setting environment for vrn

vrn en centos7

Notas

docker pull nvcr.io/nvidia/cudagl:9.1-devel-centos7

9.1-devel-centos7: Pulling from nvidia/cudagl

nvidia-docker run -it --gpus all --shm-size=1g --ulimit memlock=-1 --ulimit stack=67108864 -v ~/repo:/workspace/repo nvcr.io/nvidia/cudagl:9.1-devel-centos7 /bin/bash

Dentro del contenedor

yum install glog-devel boost-devel

Agregar Repositorio EPEL para instalar pip yum install epel-release Instalar pip yum install python-pip Dependencias de desarrollo yum install python-devel

pip install dlib

debido a error al intentar descargar actualizar pip a la version 20.3.1 pip install --upgrade pip

Para evitar conflicto con la nueva version (3.1) que requiere python 3.6 pip install matplotlib==2.1.2

pip install numpy pip install visvis pip install imageio

Instalación de torch

mkdir -p $HOME/usr/{local,src} cd $HOME/usr/local git clone https://github.com/torch/distro.git mv distro torch cd torch

Antes de ejecutar el install-deps quitar los sudo en vim :%s/sudo//gc *se puede omitir la confirmacion ./install-deps

torch/cutorch#797 Cuda 9 added half operators in the cuda half header. Half operations in torch predate that so they already existed in torch. This keeps the half definition from the cuda header, while not compiling the operators. export TORCH_NVCC_FLAGS="-D__CUDA_NO_HALF_OPERATORS__" ./install.sh

source $HOME/usr/local/torch/install/bin/torch-activate

Install THPP and fb.python for the face alignment code

cd ~ git clone https://github.com/google/glog.git cd glog git checkout v0.3.4 ./ ./configure && make && make install

No estoy seguro de si esto funcionara... hyperrealm/libconfig#22 (comment) https://stackoverflow.com/questions/5731023/autotools-force-make-not-to-rebuild-configure-makefile/5745366#5745366 make AUTOCONF=: AUTOHEADER=: AUTOMAKE=: ACLOCAL=: make install AUTOCONF=: AUTOHEADER=: AUTOMAKE=: ACLOCAL=:

cd $HOME/usr/src git clone https://github.com/1adrianb/thpp.git cd thpp/thpp

THPP_NOFB=1 ./build.sh

Install fb.python

cd $HOME/usr/src git clone https://github.com/facebook/fblualib.git cd fblualib/fblualib/python luarocks make rockspec/*

Clonar el repo y correrlo

cd $HOME git clone --recursive https://github.com/AaronJackson/vrn.git cd vrn

no se encuentra wget en el sistema, instalarlo yum install wget ./download.sh

matplotlib no funciona bien desde pip

cd ~ mkdir matplotlib wget https://downloads.sourceforge.net/project/matplotlib/matplotlib/matplotlib-1.4.3/matplotlib-1.4.3.tar.gz

tar xvzf matplotlib-1.4.3.tar.gz cd matplotlib-1.4.3 python setup.py build python setup.py install

Instalar cuDNN

/root/usr/local/torch/install/bin/luajit: /root/usr/local/torch/install/share/lua/5.1/trepl/init.lua:389: /root/usr/local/torch/install/share/lua/5.1/trepl/init.lua:389: /root/usr/local/torch/install/share/lua/5.1/cudnn/ffi.lua:1603: 'libcudnn (R5) not found in library path. Please install CuDNN from https://developer.nvidia.com/cuDNN Then make sure files named as libcudnn.so.5 or libcudnn.5.dylib are placed in your library load path (for example /usr/local/lib , or manually add a path to LD_LIBRARY_PATH)

Alternatively, set the path to libcudnn.so.5 or libcudnn.5.dylib to the environment variable CUDNN_PATH and rerun torch. For example: export CUDNN_PATH="/usr/local/cuda/lib64/libcudnn.so.5" cd /workspace/repo/cudnn-5 tar -xzf cudnn-8.0-linux-x64-v5.1.tgz cd cuda export LD_LIBRARY_PATH=pwd:$LD_LIBRARY_PATH export CUDNN_PATH="/workspace/repo/cudnn-5/cuda/lib64/libcudnn.so.5" Add to your build and link process by adding -I to your compile line and -L -lcudnn to your link line.

no lo tenía entre las dependencias pip install dlib

yum install matio export LIBRARY_PATH=$LIBRARY_PATH:/usr/lib64 ln -s /usr/lib64/libmatio.so.9 /usr/lib64/libmatio.so

git clone https://github.com/htwaijry/npy4th.git cd npy4th luarocks make

AaronJackson/vrn#59 En el archivo /face-alignment/facedetection_dlib.lua Cambiar la linea... local detections = py.reval('[np.asarray([d.left(), d.top(), d.right(), d.bottom()]) for i, d in enumerate(dets)]',{dets=dets}) por: local detections = py.reval('[np.asarray([d.left(), d.top(), d.right(), d.bottom()],dtype=float) for i, d in enumerate(dets)]',{dets=dets})

ERROR EN run.sh luajit getrf : Lapack library not found in compile timeat /root/usr/local/torch/pkg/torch/lib/TH/generic/THLapack.c:140

cd ~ git clone https://github.com/xianyi/OpenBLAS.git

cd OpenBLAS/ make clean make CC=gcc FC=gfortran USE_OPENMP=1 NUM_THREADS=8

NO_AFFINITY=1 make install export CMAKE_LIBRARY_PATH=/opt/OpenBLAS/include:/opt/OpenBLAS/lib:$CMAKE_LIBRARY_PATH luarocks build torch-scm-1.rockspec

"Imageio Pillow plugin requires " "Pillow, not PIL!" pip install --target=/usr/lib64/python2.7/site-packages/ --upgrade pillow

cd ~/vrn ./run.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment