Giter Club home page Giter Club logo

00self-linux_trial_and_error's Introduction

LinuxGuide

  • 이슈에 자세한 내용과 여러 네트워크에 대한 해결 방안을 기술
  • 쉘스크립트에 대한 공부
  • 공부 리뷰(WIKI)
  • 리눅스 서버 관리 도커에 대한 리뷰(WIKI)

file abstraction

caffe_bashrc : ivcl_server bashrc save file
caffe_makefile.config : ivcl_server makefile.config save file

gputestcode 1 : gpu available check
gputestcode 2 : gpu cnn check, gpu distribution check


PROJECTS

  • S2VT 기록 (closed)
  • 도커 공부 기록 (closed)
  • S2VT + COCO-EVALUATION (closed)
  • INCEPTION

WIKI

  • S2VT( Sequence to Sequence -- Video to Text ) - video captioning
  • Docker
  • COCO-EVALUATION
  • Inception_V4

Reference

gputestcode : http://solarisailab.com/archives/303

00self-linux_trial_and_error's People

Contributors

chldydgh4687 avatar

Watchers

 avatar  avatar

00self-linux_trial_and_error's Issues

[Tip] [Linux]_CUDA 9.0 설치(현 : 18.04 LTS)

runfile에 해당하는 base 파일과 patch파일을 받은 뒤 해당 경로로 가서 다음의 명령어를 진행합니다.
설치이전에 update 와 upgrade를 충분히 하신 뒤에 libraries를 다운 받고 진행하세요.

$sudo apt-get install g++ freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libglu1-mesa libglu1-mesa-dev
$sudo apt-get install freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libgl1-mesa-glx libglu1-mesa libglu1-mesa-dev libglfw3-dev libgles2-mesa-dev
$chmod a+x cuda*
$sudo ./sudo sh cuda_9.0.176_384.81_linux.run --override compiler

이 후 cuda 설명을 스페이스바, 엔터를 누르다보면, 다음과 같은 설치 설정이 뜨는데 그대로 입력하면된다.

-----------------
Do you accept the previously read EULA?
accept/decline/quit: accept          

You are attempting to install on an unsupported configuration. Do you wish to continue?
(y)es/(n)o [ default is no ]: y

Install NVIDIA Accelerated Graphics Driver for Linux-x86_64 384.81?
(y)es/(n)o/(q)uit: n

Install the CUDA 9.0 Toolkit?
(y)es/(n)o/(q)uit: y

Enter Toolkit Location
 [ default is /usr/local/cuda-9.0 ]: 

Do you want to install a symbolic link at /usr/local/cuda?
(y)es/(n)o/(q)uit: y

Install the CUDA 9.0 Samples?
(y)es/(n)o/(q)uit: y

Enter CUDA Samples Location
 [ default is /home/ivcl ]: 

Installing the CUDA Toolkit in /usr/local/cuda-9.0 ...
Installing the CUDA Samples in /home/ivcl ...
Copying samples to /home/ivcl/NVIDIA_CUDA-9.0_Samples now...
Finished copying samples.

===========
= Summary =
===========

Driver:   Not Selected
Toolkit:  Installed in /usr/local/cuda-9.0
Samples:  Installed in /home/ivcl

Please make sure that
 -   PATH includes /usr/local/cuda-9.0/bin
 -   LD_LIBRARY_PATH includes /usr/local/cuda-9.0/lib64, or, add /usr/local/cuda-9.0/lib64 to /etc/ld.so.conf and run ldconfig as root

To uninstall the CUDA Toolkit, run the uninstall script in /usr/local/cuda-9.0/bin

Please see CUDA_Installation_Guide_Linux.pdf in /usr/local/cuda-9.0/doc/pdf for detailed information on setting up CUDA.

***WARNING: Incomplete installation! This installation did not install the CUDA Driver. A driver of version at least 384.00 is required for CUDA 9.0 functionality to work.
To install the driver using this installer, run the following command, replacing <CudaInstaller> with the name of this run file:
    sudo <CudaInstaller>.run -silent -driver

Logfile is /tmp/cuda_install_15209.log

위 Summary 처럼 Toolkit과 sampoles가 제대로 잡히면 성공이다. 어떠한 부정어가 떠서 위와 다를 경우 아래를 참고하여 위와 같은 화면을 띄우도록 한다. 이제 패치를 설치도 똑같은 방법으로 설치한 이 후 cuda의 경로를 설정해주면 된다.

[Solved]caffe_ImportError: No module named skimage.io

Python 2.7.17 |Anaconda, Inc.| (default, Oct 21 2019, 19:04:46)
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.

import caffe
Traceback (most recent call last):
File "", line 1, in
File "/home/yonge/caffe/python/caffe/init.py", line 1, in
from .pycaffe import Net, SGDSolver, NesterovSolver, AdaGradSolver, RMSPropSolver, AdaDeltaSolver, AdamSolver, NCCL, Timer
File "/home/yonge/caffe/python/caffe/pycaffe.py", line 15, in
import caffe.io
File "/home/yonge/caffe/python/caffe/io.py", line 2, in
import skimage.io
ImportError: No module named skimage.io

[Solved]caffe_undefined reference to 'TIFF...' 오류

$ make all
.
.
.
NVCC src/caffe/solvers/nesterov_solver.cu
NVCC src/caffe/solvers/adadelta_solver.cu
NVCC src/caffe/solvers/adam_solver.cu
NVCC src/caffe/util/math_functions.cu
NVCC src/caffe/util/im2col.cu
AR -o .build_release/lib/libcaffe.a
LD -o .build_release/lib/libcaffe.so.1.0.0
CXX tools/extract_features.cpp
CXX/LD -o .build_release/tools/extract_features.bin
/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/libopencv_imgcodecs.so: undefined reference to `TIFFReadRGBAStrip@LIBTIFF_4.0'
//usr/lib/x86_64-linux-gnu/libgeotiff.so.2: undefined reference to `_TIFFmemcpy@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/libopencv_imgcodecs.so: undefined reference to `TIFFReadDirectory@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFClientdata@LIBTIFF_4.0'
//usr/lib/x86_64-linux-gnu/libgeotiff.so.2: undefined reference to `_TIFFrealloc@LIBTIFF_4.0'
//usr/lib/x86_64-linux-gnu/libgeotiff.so.2: undefined reference to `_TIFFmemset@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFLastDirectory@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFReadRGBAStripExt@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/libopencv_imgcodecs.so: undefined reference to `TIFFWriteEncodedStrip@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFSwabArrayOfShort@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/libopencv_imgcodecs.so: undefined reference to `TIFFIsTiled@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFIsByteSwapped@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFFlushData@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFWriteCheck@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFSetWriteOffset@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFDefaultStripSize@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFScanlineSize64@LIBTIFF_4.0'
//usr/lib/x86_64-linux-gnu/libpoppler.so.73: undefined reference to `TIFFFdOpen@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFIsBigEndian@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/libopencv_imgcodecs.so: undefined reference to `TIFFWriteScanline@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `_TIFFfree@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFSwabShort@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFFreeDirectory@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/libopencv_imgcodecs.so: undefined reference to `TIFFGetField@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/libopencv_imgcodecs.so: undefined reference to `TIFFNumberOfStrips@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFWriteBufferSetup@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/libopencv_imgcodecs.so: undefined reference to `TIFFScanlineSize@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFWriteEncodedTile@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFSwabLong@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFTileSize@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFWriteDirectory@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/libopencv_imgcodecs.so: undefined reference to `TIFFReadEncodedTile@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/libopencv_imgcodecs.so: undefined reference to `TIFFReadRGBATile@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/libopencv_imgcodecs.so: undefined reference to `TIFFClose@LIBTIFF_4.0'
//usr/lib/x86_64-linux-gnu/libgeotiff.so.2: undefined reference to `TIFFClientOpen@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFFlush@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFSetTagExtender@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/libopencv_imgcodecs.so: undefined reference to `TIFFRGBAImageOK@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFWriteRawStrip@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFErrorExt@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFGetFieldDefaulted@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFSwabArrayOfLong@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFNumberOfDirectories@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFTileSize64@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFWriteRawTile@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFStripSize64@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/libopencv_imgcodecs.so: undefined reference to `TIFFOpen@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFCreateDirectory@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFSetSubDirectory@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFStripSize@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFSwabArrayOfDouble@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFReadRGBATileExt@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/libopencv_imgcodecs.so: undefined reference to `TIFFReadEncodedStrip@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFUnlinkDirectory@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFUnsetField@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/libopencv_imgcodecs.so: undefined reference to `TIFFSetField@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFMergeFieldInfo@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFCurrentDirOffset@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFIsCODECConfigured@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFDataWidth@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/libopencv_imgcodecs.so: undefined reference to `TIFFSetWarningHandler@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFGetConfiguredCODECs@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/libopencv_imgcodecs.so: undefined reference to `TIFFSetErrorHandler@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFGetSizeProc@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFRewriteDirectory@LIBTIFF_4.0'
//usr/lib/x86_64-linux-gnu/libgeotiff.so.2: undefined reference to `_TIFFmalloc@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFSetDirectory@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFReadScanline@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFNumberOfTiles@LIBTIFF_4.0'
collect2: error: ld returned 1 exit status
Makefile:635: recipe for target '.build_release/tools/extract_features.bin' failed
make: *** [.build_release/tools/extract_features.bin] Error 1

[SOLVED] BVLC/caffe#1559

$ conda uninstall libtiff

It works well.

[Solved]caffe_ImportError_ (Saving my bashrc, makeconfig)

Installed my spec

  • graphics
    2080 TI GRAPHICS (440.44)
    CUDA 9.0 (17.04 LTS)
    CUDNN 7.4.2

  • python
    PYTHON 2.7 ANACONDA2
    TENSORFLOW-GPU 1.12

  • caffe
    you will pass the 'make all - make pycaffe' 'caffe path' course.

Problem is

when you typed 'import caffe' in python shell,
If ImportError occur, maybe This problem is ~./bashrc path problem.


1. how to typing a number of path.

ex) LD_LIBRARY_PATH

2. This export part is the most important part.

caffe import error happen to wrong PYTHONPATH
lib import error, protobuf error happen to LD_LIBRARY_PATH
keep attention to your ~/.bashrc

export PATH=/usr/local/cuda-9.0/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/home/ivcl/anaconda2/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/ivcl/caffe/distribute/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/ivcl/caffe/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-9.0/lib64
export PYTHONPATH=/home/ivcl/caffe/python

This is my ~/.bashrc
please refer to something at your work.

# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples

# If not running interactively, don't do anything
case $- in
    *i*) ;;
      *) return;;
esac

# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth

# append to the history file, don't overwrite it
shopt -s histappend

# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize

# If set, the pattern "**" used in a pathname expansion context will
# match all files and zero or more directories and subdirectories.
#shopt -s globstar

# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"

# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
    debian_chroot=$(cat /etc/debian_chroot)
fi

# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
    xterm-color|*-256color) color_prompt=yes;;
esac

# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
#force_color_prompt=yes

if [ -n "$force_color_prompt" ]; then
    if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
	# We have color support; assume it's compliant with Ecma-48
	# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
	# a case would tend to support setf rather than setaf.)
	color_prompt=yes
    else
	color_prompt=
    fi
fi

if [ "$color_prompt" = yes ]; then
    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt

# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
    PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
    ;;
*)
    ;;
esac

# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
    test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
    alias ls='ls --color=auto'
    #alias dir='dir --color=auto'
    #alias vdir='vdir --color=auto'

    alias grep='grep --color=auto'
    alias fgrep='fgrep --color=auto'
    alias egrep='egrep --color=auto'
fi

# colored GCC warnings and errors
#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'

# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'

# Add an "alert" alias for long running commands.  Use like so:
#   sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'

# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.

if [ -f ~/.bash_aliases ]; then
    . ~/.bash_aliases
fi

# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
  if [ -f /usr/share/bash-completion/bash_completion ]; then
    . /usr/share/bash-completion/bash_completion
  elif [ -f /etc/bash_completion ]; then
    . /etc/bash_completion
  fi
fi

export PATH=/usr/local/cuda-9.0/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/home/ivcl/anaconda2/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/ivcl/caffe/distribute/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/ivcl/caffe/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-9.0/lib64
export PYTHONPATH=/home/ivcl/caffe/python

# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/home/ivcl/anaconda2/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
    eval "$__conda_setup"
else
    if [ -f "/home/ivcl/anaconda2/etc/profile.d/conda.sh" ]; then
        . "/home/ivcl/anaconda2/etc/profile.d/conda.sh"
    else
        export PATH="/home/ivcl/anaconda2/bin:$PATH"
    fi
fi
unset __conda_setup
# <<< conda initialize <<<

And This is my caffe/Makefile.config

# USE_OPENCV := 0
# USE_LEVELDB := 0
# USE_LMDB := 0
# This code is taken from https://github.com/sh1r0/caffe-android-lib
# USE_HDF5 := 0

# uncomment to allow MDB_NOLOCK when reading LMDB files (only if necessary)
#	You should not set this flag if you will be reading LMDBs with any
#	possibility of simultaneous read and write
# ALLOW_LMDB_NOLOCK := 1

# Uncomment if you're using OpenCV 3
OPENCV_VERSION := 3

# To customize your choice of compiler, uncomment and set the following.
# N.B. the default for Linux is g++ and the default for OSX is clang++
# CUSTOM_CXX := g++

# CUDA directory contains bin/ and lib/ directories that we need.
CUDA_DIR := /usr/local/cuda
# On Ubuntu 14.04, if cuda tools are installed via
# "sudo apt-get install nvidia-cuda-toolkit" then use this instead:
# CUDA_DIR := /usr

# CUDA architecture setting: going with all of them.
# For CUDA < 6.0, comment the *_50 through *_61 lines for compatibility.
# For CUDA < 8.0, comment the *_60 and *_61 lines for compatibility.
# For CUDA >= 9.0, comment the *_20 and *_21 lines for compatibility.
CUDA_ARCH := 
#-gencode arch=compute_20,code=sm_20 \
#-gencode arch=compute_20,code=sm_21 \
		-gencode arch=compute_30,code=sm_30 \
		-gencode arch=compute_35,code=sm_35 \
		-gencode arch=compute_50,code=sm_50 \
		-gencode arch=compute_52,code=sm_52 \
		-gencode arch=compute_60,code=sm_60 \
		-gencode arch=compute_61,code=sm_61 \
		-gencode arch=compute_61,code=compute_61

# BLAS choice:
# atlas for ATLAS (default)
# mkl for MKL
# open for OpenBlas
BLAS := atlas
# Custom (MKL/ATLAS/OpenBLAS) include and lib directories.
# Leave commented to accept the defaults for your choice of BLAS
# (which should work)!
# BLAS_INCLUDE := /path/to/your/blas
# BLAS_LIB := /path/to/your/blas

# Homebrew puts openblas in a directory that is not on the standard search path
# BLAS_INCLUDE := $(shell brew --prefix openblas)/include
# BLAS_LIB := $(shell brew --prefix openblas)/lib

# This is required only if you will compile the matlab interface.
# MATLAB directory should contain the mex binary in /bin.
# MATLAB_DIR := /usr/local
# MATLAB_DIR := /Applications/MATLAB_R2012b.app

# NOTE: this is required only if you will compile the python interface.
# We need to be able to find Python.h and numpy/arrayobject.h.
#PYTHON_INCLUDE := /usr/include/python2.7 \
		/usr/lib/python2.7/dist-packages/numpy/core/include
# Anaconda Python distribution is quite popular. Include path:
# Verify anaconda location, sometimes it's in root.
ANACONDA_HOME := /home/ivcl/anaconda2
PYTHON_INCLUDE := $(ANACONDA_HOME)/include \
		 $(ANACONDA_HOME)/include/python2.7 \
		 $(ANACONDA_HOME)/lib/python2.7/site-packages/numpy/core/include

# Uncomment to use Python 3 (default is Python 2)
# PYTHON_LIBRARIES := boost_python3 python3.5m
# PYTHON_INCLUDE := /usr/include/python3.5m \
#                 /usr/lib/python3.5/dist-packages/numpy/core/include

# We need to be able to find libpythonX.X.so or .dylib.
#PYTHON_LIB := /usr/lib
PYTHON_LIB := $(ANACONDA_HOME)/lib

# Homebrew installs numpy in a non standard path (keg only)
# PYTHON_INCLUDE += $(dir $(shell python -c 'import numpy.core; print(numpy.core.__file__)'))/include
# PYTHON_LIB += $(shell brew --prefix numpy)/lib

# Uncomment to support layers written in Python (will link against Python libs)
# WITH_PYTHON_LAYER := 1

# Whatever else you find you need goes here.
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib/x86_64-linux-gnu/hdf5/serial

# If Homebrew is installed at a non standard location (for example your home directory) and you use it for general dependencies
# INCLUDE_DIRS += $(shell brew --prefix)/include
# LIBRARY_DIRS += $(shell brew --prefix)/lib

# NCCL acceleration switch (uncomment to build with NCCL)
# https://github.com/NVIDIA/nccl (last tested version: v1.2.3-1+cuda8.0)
# USE_NCCL := 1

# Uncomment to use `pkg-config` to specify OpenCV library paths.
# (Usually not necessary -- OpenCV libraries are normally installed in one of the above $LIBRARY_DIRS.)
# USE_PKG_CONFIG := 1

# N.B. both build and distribute dirs are cleared on `make clean`
BUILD_DIR := build
DISTRIBUTE_DIR := distribute

# Uncomment for debugging. Does not work on OSX due to https://github.com/BVLC/caffe/issues/171
# DEBUG := 1

# The ID of the GPU that 'make runtest' will use to run unit tests.
TEST_GPUID := 0

# enable pretty build (comment to see full commands)
Q ?= @

[Solved] [Linux] ANACONDA2 conda 명령어에러( NotWritableError: The current user does not have write permissions...)

가상환경 생성하는 명령어를 쳤다

conda create --name ai python=2.7

[Problem]

NotWritableError: The current user does not have write permissions to a required path.
  path: /home/yonge/.conda/envs/.conda_envs_dir_test
  uid: 1000
  gid: 1000

If you feel that permissions on this path are set incorrectly, you can manually
change them by executing

  $ sudo chown 1000:1000 /home/yonge/.conda/envs/.conda_envs_dir_test

In general, it's not advisable to use 'sudo conda'.

[Solved]
다음의 명령어를 실행하고 해결됬다.

sudo chown -R '사용자' anaconda2

conda config --add channels conda-canary
conda update -n base conda

[Tip] 도커 설명서 (작성중..)

도커 설치를 위한 curl 설치

$ sudo apt-get install -y curl


도커 설치

$ curl -fsSL https://get.docker.com/ | sudo sh


도커 권한 부여

$ sudo usermod -aG docker $USER #현재 접속중인 사용자에게 권한주기
$ sudo usermod -aG docker your-user #your-user 사용자에게 권한주기


컨테이너 명령어

  • 도커 컨테이너 리스트 확인

$ docker ps -a

  • 도커 컨테이너 삭제

$ docker rm (컨테이너ID or 이름)

  • 도커 컨테이너 전체 삭제

$ docker rm -v $(docker ps -a -q -f status=exited)


서버를 위한 OS 복제

  1. 서버 이미지화 시키기
$ sudo su
# tar --numeric-owner --exclude=/proc --exclude=/sys -cvf linux_18.04_server_org.tar /
  1. docker 서버로 tar 파일을 복사 후 docker에 import
  • 오래기달리기.. cat의 명령줄을 치면 아래와 같은 결과가 나옴.
# cat linux_18.04_server_org.tar | docker import - linux_18.04_server_org linux_18.04_server_org

sha256:9317820ec092145201488f9b5686093407b4fcb939cabbff39631ba3afac07c9
  1. import 정상 확인
# docker run -i -t linux_18.04_server_org /bin/bash

docker hub에 이미지 보내주기

$ docker tag (이미지 이름) (계정정보)/(repository):(hub에 생성할 이름)
ex) docker tag linux_18.04_server_org chldydgh4687/ivcl_server:linux_18.04_server_org

$ docker push (계정정보)/(repository):(hub에 생성한 이름)
ex) docker push chldydgh4687/ivcl_server:linux_18.04_server_org


docker hub에서 이미지 불러오기

$ docker pull (계정정보)/(repository):(hub에 있는 이미지 이름)

ex) docker pull chldydgh4687/ivcl_server:linux_18.04_server_org


docker 이미지 확인

$ docker images

docker 이미지 삭제

$ docker rmi (이미지이름) or (이미지_id)

이미지 pull 이후 사용하기

$ docker run -it --name (원하는이름) (이미지 repository) /bin/bash

  • /bin/bash : 해당 컨테이너의 bash shell을 실행(dockfile)
    ex) docker run -it --name yhchoi linux_18.04_server_org /bin/bash

exit 하고 빠져나와서 다시 시작할 때

$ docker restart yhchoi
$ docker attach yhchoi
$ docker restart (이전에 지정했던 이름)


이미지 덮어쓰기 (하고있는 중..!)

[Solved]caffe_protobuf: no such file or directory

caffe make 중에 뜨는 오류

CXX .build_release/src/caffe/proto/caffe.pb.cc
In file included from .build_release/src/caffe/proto/caffe.pb.cc:4:0:
.build_release/src/caffe/proto/caffe.pb.h:10:40: fatal error: google/protobuf/port_def.inc: No such file or directory
 #include <google/protobuf/port_def.inc>
                                        ^
compilation terminated.
Makefile:598: recipe for target '.build_release/src/caffe/proto/caffe.pb.o' failed
make: *** [.build_release/src/caffe/proto/caffe.pb.o] Error 1

[Solved]caffe_ImportError: No module named caffe

다른 에러가 아니고

$ make all
$ make pycaffe 

까지 완벽하게 진행되었을 때 python 에서 import가 안되는 경우이다.

ERROR

import caffe
Traceback (most recent call last):
File "", line 1, in
ImportError: No module named caffe

python 에서 caffe를 못찾을 경우일 가능성이 크다.

[TIP][Linux] 압축,해제

$sudo apt-get install unzip
$sudo apt-get install unrar
#현재 풀더에 그대로 디렉토리 무시하고 모든 파일 압축해제
$unrar e '파일명'.rar
#현재 풀더에 디렉토리 구조 적용하고 모든 파일 압축해제
$unrar x '파일명'.rar

[SOLVED][pytorch]THCudaCheck FAIL file=/pytorch/aten/src/THC/THCGeneral.cpp line=405 error=11 : invalid argument

link : pytorch/pytorch#15797

    I have the same issue. RTX2080, for CUDA 10.0 and pytorch 1.0.0. Anyone has solved the same problem please provide the information of the solution. It would help a lot of people. Thanks!

Okay I have solve the problem. You cannot directly install pytorch, instead “pip3 install -U https://download.pytorch.org/whl/cu100/torch-1.0.0-cp36-cp36m-linux_x86_64.whl” work for me.

IN MY CASE,

“pip3 install -U https://download.pytorch.org/whl/cu90/torch-1.0.0-cp36-cp36m-linux_x86_64.whl"
it works for me.

[Tip]_cudnn7.4.2_(CUDA 9.0) 설치

구글에 cudnn 설치를 찾아보면 회원가입고 각 버전이 있는 archive note 같은 곳으로 가는 방법이 있다. 그 이후 7.4.2 에서 전에 설치한 cuda 버전에 리눅스에 해당하는 버전을 다운받는다.

image

[TIP] [Linux] Tensorflow_GPU 할당

1.터미널에서 python code를 실행하는 경우:

$ CUDA_VISIBLE_DEVICES=0 python script.py  
$ CUDA_VISIBLE_DEVICES=1 python script.py  
$ CUDA_VISIBLE_DEVICES=2,3 python script.py 
  1. 코드에 직접 python code를 넣는 방법:
import os

os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID"   
os.environ["CUDA_VISIBLE_DEVICES"]="0"

[Solved] [S2VT] RuntimeError: The ffmpeg plugin does not work on Python 2.x

Traceback (most recent call last):
File "/home/ivcl/Desktop/git/video-captioning/s2vt_sample.py", line 30, in
extract_feats(video_path+'test_m.mp4',4)
File "/home/ivcl/Desktop/git/video-captioning/Extract_Feats.py", line 34, in extract_feats
vid = imageio.get_reader(file,'mkv')
File "/home/ivcl/anaconda2/envs/ai/lib/python2.7/site-packages/imageio/core/functions.py", line 186, in get_reader
return format.get_reader(request)
File "/home/ivcl/anaconda2/envs/ai/lib/python2.7/site-packages/imageio/core/format.py", line 164, in get_reader
return self.Reader(self, request)
File "/home/ivcl/anaconda2/envs/ai/lib/python2.7/site-packages/imageio/core/format.py", line 214, in init
self._open(**self.request.kwargs.copy())
File "/home/ivcl/anaconda2/envs/ai/lib/python2.7/site-packages/imageio/plugins/ffmpeg.py", line 261, in _open
self._ffmpeg_api = _get_ffmpeg_api()
File "/home/ivcl/anaconda2/envs/ai/lib/python2.7/site-packages/imageio/plugins/ffmpeg.py", line 61, in _get_ffmpeg_api
raise RuntimeError("The ffmpeg plugin does not work on Python 2.x")
RuntimeError: The ffmpeg plugin does not work on Python 2.x

[solved] [Linux] USB부팅 프리징현상 (현 : 18.04 LTS)

BIOS 에서 설치할 때 ubuntu 로딩 화면에서 넘어가지않고 한칸에서 멈춰버리는 현상이 있습니다.

이는 기존의 nvidia 그래픽 드라이버와 리눅스 드라이버가 충돌하는 것이라 합니다.

해결방법 : 메뉴 선택하는 GRUB 부분에서 'e' 를 눌러

~~splash 옆부분에 nomodeset 를 추가시킨 후 F10 을 눌러 부팅을 시키시고 설치 진행하시면 됩니다.

[TIP][Linux] 구글 드라이브 파일 다운로드받기 shell 명령어

* 일반 크기의 파일

wget --no-check-certificate 'https://docs.google.com/uc?export=download&id=FILEID' -O FILENAME

 

* 큰 크기의 파일 ("파일이 너무 커서 Google에서 바이러스를 검사할 수 없습니다. 그래도 파일을 다운로드하시겠습니까?" 라고 뜨는 파일들)

curl -c ./cookie -s -L "https://drive.google.com/uc?export=download&id=FILEID" > /dev/null
curl -Lb ./cookie "https://drive.google.com/uc?export=download&confirm=`awk '/download/ {print $NF}' ./cookie`&id=FILEID" -o FILDNAME

[TIP] [Linux] 설치 else 선택시 파티션 설정 (멀티부팅) (현 : 18.04 LTS)

  1. 윈도우를 깔고 어느 정도 리눅스를 깔아야할 용량이 필요하다.

  2. LEGACY모드가 아닌 UEFI 의 경우 efi 형식으로 되어있는 windows manager이 보인다.

  3. 이에 따라 남은 용량에 efi 파티션으로 primary / 시작 시점 / 512 mb 로 생성해준다.

  4. 나머지 용량은 ex4 파일 시스템으로 primary / 시작 지점 / 나머지용량 / 위치는 ' / ' 로 설정해준다.

  5. (예전의 스왑 영역 생성은 18.04 에서는 안해도 된다.)

[Tip] 우분투 한글 설정

  1. 윈도우키를 통하여, language support 검색

  2. Install를 통해 korean 을 설치한다.

  3. sudo reboot 재부팅

  4. settings - language 부분에서 korean(hangul) 을 추가

  5. 터미널 창에서 ibus-setup 에 한글을 추가!

  6. 우측 위에 한/영키 바뀌는 곳에 set up을 통하여 단축키를 '한/영' 키로 설정한다.

[Tip] [Linux] 멀티부트 설치 정리 (현 : 18.04 LTS, Windows 10)

기존의 UEFI 모드일 때, WIindow Boot Manager이 보일 때,

우선 bios 에서 우선순위로 usb를 설정 후, bios 들어가기 전 단계에서 shift, f10을 누르고 있으면, grub 메뉴가 뜬다. 이 때 'e' 를 눌러 splash 옆 nomodeset을 작성하고 f10을 누른다.

18.04 버전에서 swap 버전을 만들지 않아도 되므로 (512mb /주/efi/) 으로 하나를 설정하고,
나머지 용량을 (주/ex4/ 파일 경로: / )로 설정해준다.

이 후 shift, f10을 한번 더 눌러서 nomodeset으로 리눅스에 접속하고,

끝나면 반드시
$sudo gedit /etc/default/grub

#..hidden 이 곳에 주석처리
splash 옆에 nomodeset을 쓰고 저장한다.

멀티부트를 설치할 때, Window Boot Manager 가 ubuntu 파티션에서 뜨지 않는 경우

본 윈도우 USB가 CSM 모드에서 먹혀서 설치했는데 우분투로 멀티부트 깔 때, Window boot manager가 보이지 않았음.

이는 legacy 모드로 윈도우가 설치된 것임으로 우분투 또한 legacy 모드로 기존의 csm 에서 위에 해당하는 우분투 usb를 선택하여 깐다. 기존에 UEFI 에서 보던 메뉴와는 다르다. 이 때, 기존의 nomodeset 은 F6을 누르면 아래에 boot options = ,... 생기는데 이 줄에서 splash 옆에 nomodeset을 치고 엔터를 누르면 설치모드로 들어가진다. ( 화면이 깨져도 설치하면 원상태로 됨.)

파티션 설정은 :
먼저 swap 24gb 를 뺀 나머지를 (논리/ex4/ 파일경로: / ) 로 하여 준다.
swap 파티션은 나머지 2
4gb 로 주고 (논리/swap ) 으로 준다.

이 후 끝나면 반드시
$sudo gedit /etc/default/grub

#..hidden 이 곳에 주석처리
splash 옆에 nomodeset을 쓰고 저장한다.

아래는 파티션 설정 설치까지의 참고한 동영상.
https://www.youtube.com/watch?v=uGdrQxA0E6g

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.