chldydgh4687 / 00self-linux_trial_and_error Goto Github PK
View Code? Open in Web Editor NEWLinux & DeepLearning
Linux & DeepLearning
# train LeNet
caffe train -solver examples/mnist/lenet_solver.prototxt
# train on GPU 2
caffe train -solver examples/mnist/lenet_solver.prototxt -gpu 2
# resume training from the half-way point snapshot
caffe train -solver examples/mnist/lenet_solver.prototxt -snapshot examples/mnist/lenet_iter_5000.solverstate
vijayvee/video-captioning#22
: GIT CLONE 에서 데이터 손상으로 페이지에서 직접 다운로드를 받는다.
find YouTubeClips/ -name "*.avi" -printf "%f\n" -exec mv {} /usr/local/git/ \;
find [옮기려는 파일의 풀더/] -name "찾고싶은 *(모든).avi 파일" -printf "%f\n 진행사항 출력" -exec mv {} 원하는 곳의 풀더/ ;
$ sudo apt-get install git
$ git clone https://github.com/Anthony25/gnome-terminal-colors-solarized.git
$ cd gnome-terminal-colors-solarized
$ ./install.sh
설치는 local에 해당하는 deb 또는 run 파일로 하며, deb의 경우 옵션이 없어 그래픽 카드를 자체에서 깔아버려서 충돌이 나기 때문에 runfile 다운을 지향합니다.
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의 경로를 설정해주면 된다.
# rsync -avz moniwiki/ [email protected]:/home/yundream/backups
......
......
wikiseed/WikiSlide
wikiseed/WikiWikiWeb
wikiseed/WordIndex
sent 2189995 bytes received 23737 bytes 491940.44 bytes/sec
total size is 5698359 speedup is 2.57
외장하드 연결후에 #루트모드에서
mkdir 마운트시키려는풀더
cat /proc/partitions
#마지막 두줄이 외장하드일 것임.
mount -t exfat /dev/sdb1 생성한풀더경로
# mount: unknown filesystem type 'exfat' 에러일 경우
apt-get install exfat-fuse exfat-utils 설치 후 다시 해보기
reference link
https://blackcon.tistory.com/49
https://askubuntu.com/questions/1125158/cannot-mount-usb-hard-drive
설치 후 모니터 인식이 안된다면, 설치 된 linux의 nomodeset 이 설정이 안되있는 경우이다.
해결 방안 : 아래 이슈의 영구적으로 설정하는 방식을 사용하면 리눅스 그래픽이 인식을한다.
$ 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)
$ sudo su
# tar --numeric-owner --exclude=/proc --exclude=/sys -cvf linux_18.04_server_org.tar /
# cat linux_18.04_server_org.tar | docker import - linux_18.04_server_org linux_18.04_server_org
sha256:9317820ec092145201488f9b5686093407b4fcb939cabbff39631ba3afac07c9
# docker run -i -t linux_18.04_server_org /bin/bash
$ 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 pull (계정정보)/(repository):(hub에 있는 이미지 이름)
ex) docker pull chldydgh4687/ivcl_server:linux_18.04_server_org
$ docker images
$ docker rmi (이미지이름) or (이미지_id)
$ docker run -it --name (원하는이름) (이미지 repository) /bin/bash
$ docker restart yhchoi
$ docker attach yhchoi
$ docker restart (이전에 지정했던 이름)
nvidia-smi
(check PID)
kill -9 PID
다른 에러가 아니고
$ 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를 못찾을 경우일 가능성이 크다.
윈도우를 깔고 어느 정도 리눅스를 깔아야할 용량이 필요하다.
LEGACY모드가 아닌 UEFI 의 경우 efi 형식으로 되어있는 windows manager이 보인다.
이에 따라 남은 용량에 efi 파티션으로 primary / 시작 시점 / 512 mb 로 생성해준다.
나머지 용량은 ex4 파일 시스템으로 primary / 시작 지점 / 나머지용량 / 위치는 ' / ' 로 설정해준다.
(예전의 스왑 영역 생성은 18.04 에서는 안해도 된다.)
nvidia-smi
nvidia-settings
not loaded 그래픽카드 드라이버가 없다는 오류가 발생.
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
$sudo apt-get install unzip
$sudo apt-get install unrar
#현재 풀더에 그대로 디렉토리 무시하고 모든 파일 압축해제
$unrar e '파일명'.rar
#현재 풀더에 디렉토리 구조 적용하고 모든 파일 압축해제
$unrar x '파일명'.rar
$ apt-get update
$ apt-get install python-tk
BIOS 에서 설치할 때 ubuntu 로딩 화면에서 넘어가지않고 한칸에서 멈춰버리는 현상이 있습니다.
이는 기존의 nvidia 그래픽 드라이버와 리눅스 드라이버가 충돌하는 것이라 합니다.
해결방법 : 메뉴 선택하는 GRUB 부분에서 'e' 를 눌러
~~splash 옆부분에 nomodeset 를 추가시킨 후 F10 을 눌러 부팅을 시키시고 설치 진행하시면 됩니다.
Projects 리눅스 환경 세팅 보기
우선 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을 쓰고 저장한다.
본 윈도우 USB가 CSM 모드에서 먹혀서 설치했는데 우분투로 멀티부트 깔 때, Window boot manager가 보이지 않았음.
이는 legacy 모드로 윈도우가 설치된 것임으로 우분투 또한 legacy 모드로 기존의 csm 에서 위에 해당하는 우분투 usb를 선택하여 깐다. 기존에 UEFI 에서 보던 메뉴와는 다르다. 이 때, 기존의 nomodeset 은 F6을 누르면 아래에 boot options = ,... 생기는데 이 줄에서 splash 옆에 nomodeset을 치고 엔터를 누르면 설치모드로 들어가진다. ( 화면이 깨져도 설치하면 원상태로 됨.)
파티션 설정은 :
먼저 swap 24gb 를 뺀 나머지를 (논리/ex4/ 파일경로: / ) 로 하여 준다.4gb 로 주고 (논리/swap ) 으로 준다.
swap 파티션은 나머지 2
이 후 끝나면 반드시
$sudo gedit /etc/default/grub
#..hidden 이 곳에 주석처리
splash 옆에 nomodeset을 쓰고 저장한다.
아래는 파티션 설정 설치까지의 참고한 동영상.
https://www.youtube.com/watch?v=uGdrQxA0E6g
linux 설치 후 settings 을 누르면 마우스만 움직이고 모든 것이 멈춘다.
lspci -k 장치를 검색하는 명령어 혹은 일부 명령어를 입력했을 경우 출력을 하지 못하고 에러메시지도 뜨지 않고 다시 입력 창으로도 돌아오지 않는다.
해결중...
$ 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
$ conda uninstall libtiff
It works well.
$ sudo usermod -a -G docker $USER
$ sudo reboot
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.
when you typed 'import caffe' in python shell,
If ImportError occur, maybe This problem is ~./bashrc path problem.
ex) LD_LIBRARY_PATH
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 ?= @
* 일반 크기의 파일
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
git clone -b {branch_name} --single-branch {저장소 URL}
ex) git clone -b javajigi --single-branch https://github.com/javajigi/java-racingcar
There is influence between cuda_version and gcc version.
so, you must check cuda_version and gcc_version
#gcc version check
$ gcc -v
F0122 20:20:37.440889 25251 upgrade_proto.cpp:97] Check failed: ReadProtoFromBinaryFile(param_file, param) Failed to parse NetParameter file: ./VGG_ILSVRC_16_layers.caffemodel
*** Check failure stack trace: ***
reference link : https://codechacha.com/ko/install-nvidia-driver-ubuntu/
$pip install opencv-python
make all # 이후
make pycaffe #할 경우 오류
CXX/LD -o python/caffe/_caffe.so python/caffe/_caffe.cpp
python/caffe/_caffe.cpp:1:52: fatal error: Python.h: No such file or directory
#include <Python.h> // NOLINT(build/include_alpha)
^
compilation terminated.
Makefile:517: recipe for target 'python/caffe/_caffe.so' failed
make: *** [python/caffe/_caffe.so] Error 1
해결중...
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
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.
윈도우키를 통하여, language support 검색
Install를 통해 korean 을 설치한다.
sudo reboot 재부팅
settings - language 부분에서 korean(hangul) 을 추가
터미널 창에서 ibus-setup 에 한글을 추가!
우측 위에 한/영키 바뀌는 곳에 set up을 통하여 단축키를 '한/영' 키로 설정한다.
[https://gabii.tistory.com/entry/Ubuntu-1804-LTS-%ED%95%9C%EA%B8%80-%EC%84%A4%EC%B9%98-%EB%B0%8F-%EC%84%A4%EC%A0%95] (https://gabii.tistory.com/entry/Ubuntu-1804-LTS-%ED%95%9C%EA%B8%80-%EC%84%A4%EC%B9%98-%EB%B0%8F-%EC%84%A4%EC%A0%95)
가상환경 생성하는 명령어를 쳤다
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
해당 repo의 bashrc 파일의 경로를 보고 수정한다.
이후
$sudo ldconfig
try:
for im in reader:
ims.append(im)
except RuntimeError:
pass
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
import os
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"]="0"
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
$watch -n 0.1 nvidia-smi
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.