영상 분석을 위한 서버 환경이 CentOs 가 설치되어 있다.


tensorflow.org는 기본적으로 우분투 환경에서 완벽하게 지원하고 있는것으로 보인다.

궁극적으로는 ubuntu로 가는것이 맞는것으로 보이지만, 일단 회사 정책(기조?)가 CentOs로 넘어가고 있는 분위기라서

CentOs의 개발환경이 필요해진 상황이다.

ubuntu Install: http://cafe.naver.com/telcosn/552


영상분석 서버의 스펙은 아래와 같다.

OS: CentOS Linux release 7.3.1611

CPU: 1x E5-1650 V4 (6 Core, 15M Cache, 3.6 GHz, 140W)

MEM: 8x DDR4 PC19200 32GB ECC-REG

HDD: 3x HDD 3.5인치 SATA3 2TB

SSD: 1x 512GB SSD

POWER: POWER 2000W

GPU: NVIDIA TITAN X


CentOs TensorFlow 설치 과정

※ 많은 사람들이 CentOs에서는 python의 virtualenv 환경으로 설치하기를 권장해서 virtualenv 환경에서 설치

참고: https://www.tensorflow.org/install/install_linux 의 Installing with virtualenv


* GPU를 사용하고 있기 때문에 GPU 환경으로 설치

1. Install base

# yum -y install gcc gcc-c++ atlas atlas-devel gcc-gfortran openssl-devel libffi-devel
2. Installing with virtualenv
Take the following steps to install TensorFlow with Virtualenv:

Install pip and virtualenv by issuing one of the following commands:

 

$ sudo yum install python-pip python-devel python-virtualenv # for Python 2.7
$ sudo yum install python3-pip python3-devel python-virtualenv # for Python 3.n

 

Create a virtualenv environment by issuing one of the following commands:

 

$ virtualenv --system-site-packages targetDirectory # for Python 2.7
$ virtualenv --system-site-packages -p python3 targetDirectory # for Python 3.n

 

where targetDirectory specifies the top of the virtualenv tree. Our instructions assume that targetDirectory is ~/tensorflow, but you may choose any directory.

Activate the virtualenv environment by issuing one of the following commands:

 

$ source ~/tensorflow/bin/activate # bash, sh, ksh, or zsh
$ source ~/tensorflow/bin/activate.csh  # csh or tcsh

 

The preceding source command should change your prompt to the following:

 

(tensorflow)$ 

 

Ensure pip ≥8.1 is installed:

 

$ easy_install -U pip

 

Issue one of the following commands to install TensorFlow in the active virtualenv environment:

 


(tensorflow)$ pip install --upgrade tensorflow      # for Python 2.7(tensorflow)
$ pip3 install --upgrade tensorflow     # for Python 3.n(tensorflow)
$ pip install --upgrade tensorflow-gpu  # for Python 2.7 and GPU(tensorflow)
$ pip3 install --upgrade tensorflow-gpu # for Python 3.n and GPU

 

If the preceding command succeeds, skip Step 6. If the preceding command fails, perform Step 6.

(Optional) If Step 5 failed (typically because you invoked a pip version lower than 8.1), install TensorFlow in the active virtualenv environment by issuing a command of the following format:

 

(tensorflow)$ pip install --upgrade tfBinaryURL   # Python 2.7
(tensorflow)$ pip3 install --upgrade tfBinaryURL  # Python 3.n 

 

where tfBinaryURL identifies the URL of the TensorFlow Python package. The appropriate value of tfBinaryURLdepends on the operating system, Python version, and GPU support. Find the appropriate value for tfBinaryURL for your system here. For example, if you are installing TensorFlow for Linux, Python 3.4, and CPU-only support, issue the following command to install TensorFlow in the active virtualenv environment:

 

(tensorflow)$ pip3 install --upgrade \https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.4.0-cp34-cp34m-linux_x86_64.whl

 

If you encounter installation problems, see Common Installation Problems.
3. Next Steps After installing TensorFlow, validate the installation.
Note that you must activate the virtualenv environment each time you use TensorFlow. 
If the virtualenv environment is not currently active, invoke one of the following commands:
$ source ~/tensorflow/bin/activate      # bash, sh, ksh, or zsh
$ source ~/tensorflow/bin/activate.csh  # csh or tcsh
그래픽카드 사용시, 환경변수에 쿠다 관련 실행경로를 추가 해주어야 한다.
vi ~/venvs/tensorflow/bin/activate
PATH="$VIRTUAL_ENV/bin:$PATH:/usr/local/cuda-8.0/bin"
export PATH
LD_LIBRARY_PATH="/usr/local/cuda-8.0/lib64"
export LD_LIBRARY_PATH

When the virtualenv environment is active, you may run TensorFlow programs from this shell.
Your prompt will become the following to indicate that your tensorflow environment is active:
(tensorflow)$ 
When you are done using TensorFlow, you may deactivate the environment by invoking the deactivate function as follows:
(tensorflow)$ deactivate 
The prompt will revert back to your default prompt (as defined by the PS1 environment variable).
Uninstalling TensorFlow
To uninstall TensorFlow, simply remove the tree you created. For example:
$ rm -r targetDirectory 
※ 나의 경우에는 pip install --upgrade mock 이 설치가 안되어서 설치해줌 또한 쿠다환경은 다른 분석도구를 사용하기 위해서 사전에 설치되어 있었음
Posted by 이성윤
http://cafe.naver.com/telcosn/554 주소복사 게시글분석

강의를 듣기 시작했다.

강의를 2강의 쯤 들었을때 수학이 필요하겠다라는 생각이 들었다.

텐서플로우는 파이썬 기반으로 개발이 된듯 하다. 파이썬으로 가벼운 프로그램 만들 수 있는 수준이라면

강의 듣는데는 문제가 생기진 않는다.

수학 공부를.. 제대로 하지 않은 나로서는 고민이 많이 되었다.  필요한 수학을 먼저 공부하고 들을지

아니면 어차피 제공되는 TensorFlow API를 쓰면 되는거라 대략 이해되면 넘어갈지.


고민하던차에, 먼저 강의를 쭈욱 들어보기로 했다. 현재 섹션 7까지 들었다.

섹션 4까지는 그리큰 시간을 투자하지 않아도 언급되는 수학 수식에 대한 이해가 그렇게 어렵지는 않았다.

Logistic (Regression) Classification에서 부터는 어려움을 느꼈고, 수식이 정확히 이해되지 않아도 큰 그림과 설명하는 의도가 이해가 되면, 그냥 넘어가면서 섹션 7까지 왔다.


섹션7까지 오면서, 점점 더 언급되는 수식이라도 정확히 이해하고 강의를 듣고 싶은 마음이 들었다. 수식을 이해하고 있다면 좀더 재미를 느낄 수 있지 않을까 라는 생각이 들기도 한다.

그래서 잠시.. 갈길을 멈추고, 수식을 먼저 공부하고자 한다.



섹션 0. 오리엔테이션
수업 소개와 개요 미리보기 00:10:00
섹션 1. 머신러닝의 개념과 용어
기본적인 Machine Learnnig 의 용어와 개념 설명 미리보기 00:12:00
TensorFlow의 설치및 기본적인 operations (new) 00:17:00
섹션 2. Linear Regression 의 개념
Linear Regression의 Hypothesis 와 cost 00:13:00
Tensorflow로 간단한 linear regression을 구현 (new) 00:15:00
섹션 3. Linear Regression cost 함수 최소화
Linear Regression의 cost 최소화 알고리즘의 원리 00:16:00
Linear Regression 의 cost 최소화의 TensorFlow 구현(new) 00:15:00
섹션 4. 여러개의 입력(feature)의 Linear Regression
multi-variable linear regression (new) 00:17:00
lab 04-1: multi-variable linear regression을 TensorFlow에서 구현하기 미리보기 00:08:00
lab 04-2: TensorFlow로 파일에서 데이타 읽어오기 (new) 00:06:00
섹션 5. Logistic (Regression) Classification
Logistic Classification의 가설 함수 정의 00:15:00
Logistic Regression의 cost 함수 설명 00:14:00
TensorFlow로 Logistic Classification의 구현하기(new) 00:15:00
섹션 6. Softmax Regression (Multinomial Logistic Regression)
Multinomial 개념 소개 00:10:00
Cost 함수 소개 00:15:00
lab 06-1: TensorFlow로 Softmax Classification의 구현하기 (new) 00:12:00
lab 06-2: TensorFlow로 Fancy Softmax Classification의 구현하기 (new) 00:16:00
섹션 7. ML의 실용과 몇가지 팁
학습 rate, Overfitting, 그리고 일반화 (Regularization) 00:14:00
Training/Testing 데이타 셋 00:09:00
lab 07-1: training/test dataset, learning rate, normalization (new) 00:11:00
lab 07-2: Meet MNIST Dataset (new) 00:13:00

 

Posted by 이성윤

TensorFlow를 본격적으로 시작하기전에, 관련된 블로그, 책, 까페, 강의 뭐 이런것들에 대한 정보를 수집하였다.


처음엔 팀장님이 말한 CNN위주로 검색을 했지만, 키워드를 TensorFlow와 머신러닝에 맞추었다.


다행이도, 가장 먼저 아주 훌륭한 TensorFlow강의를 발견하게 되었다.


강의제목

모두를 위한 머신러닝/딥러닝

강의URL

https://www.inflearn.com/course/%EA%B8%B0%EB%B3%B8%EC%A0%81%EC%9D%B8-%EB%A8%B8%EC%8B%A0%EB%9F%AC%EB%8B%9D-%EB%94%A5%EB%9F%AC%EB%8B%9D-%EA%B0%95%EC%A2%8C/

1. 강좌 소개

알파고와 이세돌의 경기를 보면서 이제 머신 러닝이 인간이 잘 한다고 여겨진 직관과 의사 결정능력에서도 충분한 데이타가 있으면 어느정도 또는 우리보다 더 잘할수도 있다는 생각을 많이 하게 되었습니다. Andrew Ng 교수님이 말씀하신것 처럼 이런 시대에 머신 러닝을 잘 이해하고 잘 다룰수 있다면 그야말로 “Super Power”를 가지게 되는 것이 아닌가 생각합니다.

더 많은 분들이 머신 러닝과 딥러닝에 대해 더 이해하고 본인들의 문제를 이 멋진 도구를 이용해서 풀수 있게 하기위해 비디오 강의를 준비하였습니다. 더 나아가 이론에만 그치지 않고 최근 구글이 공개한 머신러닝을 위한 오픈소스인 TensorFlow를 이용해서 이론을 구현해 볼수 있도록 하였습니다.

이 머신러닝, 딥러닝 강좌는 수학이나 컴퓨터 공학적인 지식이 없이도 쉽게 볼수 있도록 만들려고 노력하였습니다.

2. 도움되는 분들

  • 인공지능에 대해 관심이 있는 누구나
  • 머닝러신, 딥러닝의 개념을 이해하고 싶으신분
  • 머닝러신의 직접 구현해보고 싶으신 분

3. 참고자료

이 비디오는 저도 인터넷등을 통해 공부하면서 만든것이며 아래 자료를 많이 사용하였습니다.

4. 지식공유자 소개

김성훈

Hong Kong University of Science and Technology 에서 컴퓨터 공학쪽으로 연구를 하고 있습니다.
비디오나 강의에 대한 의견이 있으시면 아래로 이메일을 보내 주시면 됩니다.
hunkim+ml@gmail.com


강의를 듣다가 이것저것 검색하다보니, 굳이 위의 사이트를 가입하지 않아도 볼 수 있었다..

http://hunkim.github.io/ml/


한마디 더 붙이자면, 김성훈 교수님같이 자신의 시간을 투자하여 아낌 없이 가지고 있는 지식을 공유하는분들이

점점 늘어나고 있다. 덕분에 많은 도움을 받고있다. 감사합니다.

Posted by 이성윤

텐서플로우를 설치한지는 좀 되었지만, 기록을 위해 적어본다.


먼저, TensorFlow를 CentOs에 설치하기 위해서는 뭔가 복잡하다고 느껴졌었는데, Unbuntu에 설치하니

너무 간단하게 설치가 완료 되었다.


TensorFlow 공식 사이트

https://www.tensorflow.org/install/install_linux#InstallingNativePip


OS: Ubuntu 16.04데스크탑 버전

python3 기반으로 설치하였다.


$ sudo apt-get install python-pip python-dev # for Python 2.7

$ sudo apt-get install python3-pip python3-dev # for Python 3.n


$ pip install tensorflow # Python 2.7; CPU support (no GPU support)

$ pip3 install tensorflow # Python 3.n; CPU support (no GPU support)


이게 끝이다.


추가로 Tensorflow 강의를 듣다 보니 필요한 유틸리티를 설치하였다.

pip3 install numpy
sudo apt-get install python3-matplotlib
sudo apt-get install python3-pandas
pip3 install ipython (이건 내가 편해서)

Posted by 이성윤