Theano & Caffe 실습
김정주
들어가며...
• 본격적인 사용법 익히기는 각 라이브러리의 Tutorial에서 진
행될 것이기에,
• 여기에서는 알아두면 좋은 기타등등을 설명하도록 하겠습니
다.
• 윈도우에서 설치는 다루지 않습니다. 죄송합니다.
GPU의 발전
• 최초의 그래픽 칩은 정해진 방식의 그리기만 가능했으나,
• 점점 다양한 그리기 옵션 지정이 가능해짐.
• 이후 아주 기본적인 연산과 참조 기능이 들어감
• 리얼타임 그래픽스을 위한 쉐이더(Shader) 언어의 시작.
• GPU(Graphics Processing Unit)으로 불리기 시작
• 게임과 실시간 그래픽 어플리케이션의 증가로 인해 급격한 성장
쉐이더 언어
GPU의 특성
• 리얼타임 그래픽스는 적당히 좋게, 그러나 빠르게가 중요
• 극히 많은 코어수로 높은 동시성 구현 가능
• 그러나 구조가 단순하고, GPU 메모리 크기 제약으로 복잡한
코드는 불가
• 조건문을 사용하면 매우 느려짐
• GPU <-> CPU 데이터 교환이 느리다
CUDA와 GPU프로그래밍
• GPU가 점점 고급화 되며 General Computing에 사용 됨
• CUDA는 C수준의 복잡한 코드를 단순한 GPU에서 실행 가
능하게 해주는 플랫폼
• 그러나 디버깅이 어렵고, 특성을 제대로 살리지 못하면 CPU
보다 느림
Theano와 Caffe는?
• 비전문가는 GPU를 활용한 연산/분석 코드 작성이 힘듦
• Theano와 Caffe는 이것을 도와주는 라이브러리
• Theano
• 다차원 배열을 사용한 수학 식을 정의, 최적화, 풀이하는
Python 라이브러리
• Caffe
• 표현력, 속도, 모듈화 지원을 고려한 딥 러닝 프레임워크
GPU 활용은 천천히
• 공부는 CPU Only 모드로 하다가,
• Caffe의 경우 CUDA 설치 필수 - 헤더/라이브러리 사용
• 최적화가 필요하면 GPU를 사용하자.
• CUDA - CUDA SDK와 드라이버가 설치되면 GPU 사용
• cuDNN - 설치되면 더 빠름 (옵션)
cuDNN
• NVIDIA의 Deep Neural Network 라이브러리
• CUDA를 사용하지만 함께 배포되지 않음
• https://developer.nvidia.com/cuDNN 에서 등록 후 인증이
되면 다운로드 가능
• cuDNN이 설치되어 있으면 더 좋은 퍼포먼스 - 필수 아님
BLAS, LAPACK, ATLAS
• CPU를 사용하는 라이브러리 들
• BLAS - 선형대수 계산을 위한 low-level 루틴 표준 규약
• LAPACK - 병렬처리 가능한 고급 선형대수 라이브러리
(BLAS 사용)
• ATLAS - 플랫폼 독립적인 BLAS 구현체 (일부 LAPACK 연
산 포함)
• OS X에서는 Accelerated framework안에 내장
BLAS, LAPACK, ATLAS 버전 확
인
>>> import numpy as np
>>> np.__config__.show()
lapack_opt_info:
extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
extra_compile_args = ['-msse3', '-DAPPLE_ACCELERATE_SGEMV_PATCH']
define_macros = [('NO_ATLAS_INFO', 3)]
openblas_lapack_info:
NOT AVAILABLE
atlas_3_10_blas_threads_info:
NOT AVAILABLE
atlas_threads_info:
NOT AVAILABLE
atlas_3_10_threads_info:
NOT AVAILABLE
atlas_blas_info:
NOT AVAILABLE
atlas_3_10_blas_info:
NOT AVAILABLE
atlas_blas_threads_info:
NOT AVAILABLE
openblas_info:
NOT AVAILABLE
blas_mkl_info:
NOT AVAILABLE
blas_opt_info:
extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
extra_compile_args = ['-msse3', '-DAPPLE_ACCELERATE_SGEMV_PATCH', '-I/System/Library/Frameworks/vecLib.framework/Headers']
define_macros = [('NO_ATLAS_INFO', 3)]
atlas_info:
NOT AVAILABLE
atlas_3_10_info:
NOT AVAILABLE
lapack_mkl_info:
NOT AVAILABLE
mkl_info:
NOT AVAILABLE
Cuda 설치
• 최신 7버전 - https://developer.nvidia.com/cuda-
downloads
• Ubuntu
• wget http://developer.download.nvidia.com/compute/cuda/7_0/Prod/
local_installers/rpmdeb/cuda-repo-ubuntu1404-7-0-
local_7.0-28_amd64.deb
• sudo dpkg -i cuda-repo-ubuntu1404-7-0-local_7.0-28_amd64.deb
• sudo apt-get update && sudo apt-get install cuda
• OS X - .dmg 파일
Theano 설치
• Installing Theano - http://deeplearning.net/software/
theano/install.html#install
• Ubuntu에서는 OpenBLAS 먼저 설치 필요
• sudo apt-get install libopenblas-dev
• pip install Theano
Ubuntu에 Caffe 설치
• http://yujuwon.tistory.com/entry/DeepLearning-우분투-1404에-
Caffe-설치-하기 - 유주원님 - 참고
• 이슈
• Cuda는 7으로 설치할 것
• 파이썬 모듈 경로 지정
• export PYTHONPATH=caffe설치폴더/python:$PYTHONPATH
• 파이썬 테스트를 위해 수정할 것 들
• https://gist.github.com/haje01/d268b745acd532849722
OS X에 Caffe 설치
• http://installing-caffe-the-right-way.wikidot.com/start 참고
• Segmentation fault: 11
• CUDA7 이전 버전 사용
• Makefile.config의 파이썬 경로 확인
• 특히! PYTHON_LIB 확인 - 빌드에 사용된 lib과 실행 lib이 다
른 경우
• PYTHON_LIB := /usr/local/Cellar/python/2.7.9/
Frameworks/Python.framework/Versions/2.7/lib/
OS X에 Caffe 설치 -2
• PyThreadState_Get: no current thread
• 파이썬 인터프리터와 모듈이 서로 다른 파이썬 라이브러리를 사용. Boost
재설치
• brew uninstall boost-python
• brew install --build-from-source --fresh -vd boost-python
• Library not loaded … libopencv_core.2.4.dylib
• OpenCV 재설치
• brew install -fs opencv
아몰랑.. Docker로
• 도커 설치
• 우분투 - http://blog.nacyot.com/articles/2014-01-27-easy-
deploy-with-docker/
• OS X / Windows - Boot2Docker 사용 https://github.com/
boot2docker/boot2docker
• 이미지 빌드
• docker build https://gist.githubusercontent.com/
haje01/7edb8b25f4c9a3b9c9d7/raw/
7e9cbcbe88814cd9df5d263fd41e90cfebb853ed/Dockerfile
AWS GPU 인스턴스 사용
• http://tleyden.github.io/blog/2014/10/25/running-caffe-on-aws-gpu-
instance-via-docker/ 참고
• CUDA지원의 GPU가 설치된 로컬 머신 대신, AWS GPU 인스턴스 사용
• 필요할 때 필요한 만큼 사용
• 확장에 용이
• 비싸지만( 일주일 13만원 정도(g2.2xlarge, 버지니아 기준) ), 필요할 때만 켜서 사
용하면 괜찮을 듯..
Theano와 Caffe 비교
• What about Caffe? - http://fastml.com/torch-vs-theano/
• “Caffe has a pretty different target. More mass market, for people who want
to use deep learning for applications. Torch and Theano are more tailored
towards people who want to use it for research on DL itself.”
• Best framework for Deep Neural Nets? - https://www.reddit.com/comments/2c9x0s
• “Theano is awesome. If you want a framework that's 'open-ended in terms
of network architecture and transfer functions', Theano is what you're
looking for. … It's definitely a different way of thinking, because you have to
specify your model symbolically (i.e. write down the equations like you
would in a paper, essentially). But once you are in that mindset it's pretty
easy to write Theano code. The effort you invest in learning this really pays
off.”
Protocol Buffers
• Google이 만든 메시지 제네레이터
• https://github.com/google/protobuf
• 스키마를 통해 메시지의 형식을 정의하면 그 메시지 타입에 대한
읽기/쓰기 코드가 자동생성
• C/C++, Java, Python, Objective-C 등 다양한 언어를 제공
• Caffe의 모든 메시지는 protobuf 형식으로 정의
• https://github.com/BVLC/caffe/blob/
85bb397acfd383a676c125c75d877642d6b39ff6/src/caffe/proto/caffe.proto
pycaffe 문서가 별로 없다..
• 코드를 읽자! 가장 중요한 두 파일:
• caffe/python/caffe/_caffe.cpp:
• Blob, Layer, Net, Solver 클래스 익스포트
• caffe/python/caffe/pycaffe.py
• Net 클래스에 추가 메소드
참고 링크
• http://developer.download.nvidia.com/compute/cuda/7_0/Prod/doc/
CUDA_Getting_Started_Linux.pdf
• http://installing-caffe-the-right-way.wikidot.com/start
• https://haduonght.wordpress.com/2015/02/21/install-caffe-on-mac-os-x-10-10/
• https://github.com/Homebrew/homebrew-science/issues/2209
• http://blog.nacyot.com/articles/2014-01-27-easy-deploy-with-docker/
• https://github.com/tleyden/docker/tree/master/caffe
• http://vision.stanford.edu/teaching/cs231n/slides/caffe_tutorial.pdf
• http://fastml.com/torch-vs-theano/
• https://www.reddit.com/comments/2c9x0s

More Related Content

PPTX
딥러닝(Deep Learing) using DeepDetect
PPTX
Openface
PDF
[232] 성능어디까지쥐어짜봤니 송태웅
PPTX
What is spark
PPTX
[D2 COMMUNITY] Spark User Group - 스파크를 통한 딥러닝 이론과 실제
PPTX
Openface
PDF
Cloudera session seoul - Spark bootcamp
PDF
백억개의 로그를 모아 검색하고 분석하고 학습도 시켜보자 : 로기스
딥러닝(Deep Learing) using DeepDetect
Openface
[232] 성능어디까지쥐어짜봤니 송태웅
What is spark
[D2 COMMUNITY] Spark User Group - 스파크를 통한 딥러닝 이론과 실제
Openface
Cloudera session seoul - Spark bootcamp
백억개의 로그를 모아 검색하고 분석하고 학습도 시켜보자 : 로기스

What's hot (20)

PDF
[241] Storm과 Elasticsearch를 활용한 로깅 플랫폼의 실시간 알람 시스템 구현
PDF
Deep learning text NLP and Spark Collaboration . 한글 딥러닝 Text NLP & Spark
PDF
Spark Day 2017@Seoul(Spark Bootcamp)
PDF
[225]빅데이터를 위한 분산 딥러닝 플랫폼 만들기
PDF
Spark & Zeppelin을 활용한 머신러닝 실전 적용기
PDF
엘라스틱서치 클러스터로 수십억 건의 데이터 운영하기
PDF
인공지능추천시스템 airs개발기_모델링과시스템
PDF
[224]nsml 상상하는 모든 것이 이루어지는 클라우드 머신러닝 플랫폼
PDF
20141223 머하웃(mahout) 협업필터링_추천시스템구현
PDF
[D2]thread dump 분석기법과 사례
PDF
[232] 수퍼컴퓨팅과 데이터 어낼리틱스
PDF
파이썬 데이터과학 1일차 - 초보자를 위한 데이터분석, 데이터시각화 (이태영)
PDF
[244] 분산 환경에서 스트림과 배치 처리 통합 모델
PDF
[231]운영체제 수준에서의 데이터베이스 성능 분석과 최적화
PDF
SPARK SQL
PDF
Java 초보자를 위한 hadoop 설정
PDF
Spark Day 2017 Machine Learning & Deep Learning With Spark
PDF
왜 Spark 와 infinispan 왜 같이 쓰지
PPT
Hadoop Introduction (1.0)
PDF
머신러닝 및 데이터 과학 연구자를 위한 python 기반 컨테이너 분산처리 플랫폼 설계 및 개발
[241] Storm과 Elasticsearch를 활용한 로깅 플랫폼의 실시간 알람 시스템 구현
Deep learning text NLP and Spark Collaboration . 한글 딥러닝 Text NLP & Spark
Spark Day 2017@Seoul(Spark Bootcamp)
[225]빅데이터를 위한 분산 딥러닝 플랫폼 만들기
Spark & Zeppelin을 활용한 머신러닝 실전 적용기
엘라스틱서치 클러스터로 수십억 건의 데이터 운영하기
인공지능추천시스템 airs개발기_모델링과시스템
[224]nsml 상상하는 모든 것이 이루어지는 클라우드 머신러닝 플랫폼
20141223 머하웃(mahout) 협업필터링_추천시스템구현
[D2]thread dump 분석기법과 사례
[232] 수퍼컴퓨팅과 데이터 어낼리틱스
파이썬 데이터과학 1일차 - 초보자를 위한 데이터분석, 데이터시각화 (이태영)
[244] 분산 환경에서 스트림과 배치 처리 통합 모델
[231]운영체제 수준에서의 데이터베이스 성능 분석과 최적화
SPARK SQL
Java 초보자를 위한 hadoop 설정
Spark Day 2017 Machine Learning & Deep Learning With Spark
왜 Spark 와 infinispan 왜 같이 쓰지
Hadoop Introduction (1.0)
머신러닝 및 데이터 과학 연구자를 위한 python 기반 컨테이너 분산처리 플랫폼 설계 및 개발
Ad

Similar to Theano 와 Caffe 실습 (20)

PPTX
Caffe Tutorial with window10, VS2015
PDF
Jetson agx xavier and nvdla introduction and usage
PPTX
CUDA 프로그래밍 기초 MODUCON2018
PDF
The Deep Learning Compiler
PPTX
헤테로지니어스 컴퓨팅 : CPU 에서 GPU 로 옮겨가기
PPTX
Lec 00, 01
PPTX
TenforFlow Internals
PDF
Auto Scalable 한 Deep Learning Production 을 위한 AI Serving Infra 구성 및 AI DevOps...
PDF
Ibm과 nvidia가 제안하는 딥러닝 플랫폼
PDF
Lablupconf session7 People don't know what they want until LABLUP show it to ...
PDF
맨땅에서 AI학습플랫폼을 만들기까지
PPTX
Apache MXNet으로 배워보는 딥러닝(Deep Learning) - 김무현 (AWS 솔루션즈아키텍트)
PDF
딥러닝 세계에 입문하기 위반 분투
PDF
Nvidia architecture
PDF
Exploring Deep Learning Acceleration Technology Embedded in LLMs
PDF
밑바닥부터 시작하는딥러닝 8장
PPTX
[3장] 딥러닝을 위한 환경 구축하기 | 수학 통계를 몰라도 이해할 수 있는 쉬운 딥러닝 | 반병현
PPTX
이기종 멀티코어 프로세서를 위한 프로그래밍 언어 및 영상처리 오픈소스
PDF
[컴퓨터비전과 인공지능] 8. 합성곱 신경망 아키텍처 5 - Others
PDF
[OpenInfra Days Korea 2018] Day 2 - E5: GPU on Kubernetes
Caffe Tutorial with window10, VS2015
Jetson agx xavier and nvdla introduction and usage
CUDA 프로그래밍 기초 MODUCON2018
The Deep Learning Compiler
헤테로지니어스 컴퓨팅 : CPU 에서 GPU 로 옮겨가기
Lec 00, 01
TenforFlow Internals
Auto Scalable 한 Deep Learning Production 을 위한 AI Serving Infra 구성 및 AI DevOps...
Ibm과 nvidia가 제안하는 딥러닝 플랫폼
Lablupconf session7 People don't know what they want until LABLUP show it to ...
맨땅에서 AI학습플랫폼을 만들기까지
Apache MXNet으로 배워보는 딥러닝(Deep Learning) - 김무현 (AWS 솔루션즈아키텍트)
딥러닝 세계에 입문하기 위반 분투
Nvidia architecture
Exploring Deep Learning Acceleration Technology Embedded in LLMs
밑바닥부터 시작하는딥러닝 8장
[3장] 딥러닝을 위한 환경 구축하기 | 수학 통계를 몰라도 이해할 수 있는 쉬운 딥러닝 | 반병현
이기종 멀티코어 프로세서를 위한 프로그래밍 언어 및 영상처리 오픈소스
[컴퓨터비전과 인공지능] 8. 합성곱 신경망 아키텍처 5 - Others
[OpenInfra Days Korea 2018] Day 2 - E5: GPU on Kubernetes
Ad

More from 정주 김 (10)

PDF
SageMaker RL 맛보기
PDF
분산 강화학습 논문(DeepMind IMPALA) 구현
PDF
소프트웨어 2.0을 활용한 게임 어뷰징 검출
PDF
파이썬으로 나만의 강화학습 환경 만들기
PDF
NDC 2016 김정주 - 기계학습을 활용한 게임어뷰징 검출
PDF
파이썬 TDD 101
PDF
WzDat과 Pandas를 통한 로그 데이터 분석
PDF
Interactive fiction
PDF
Deploying flask with nginx & uWSGI
PDF
Logging 101
SageMaker RL 맛보기
분산 강화학습 논문(DeepMind IMPALA) 구현
소프트웨어 2.0을 활용한 게임 어뷰징 검출
파이썬으로 나만의 강화학습 환경 만들기
NDC 2016 김정주 - 기계학습을 활용한 게임어뷰징 검출
파이썬 TDD 101
WzDat과 Pandas를 통한 로그 데이터 분석
Interactive fiction
Deploying flask with nginx & uWSGI
Logging 101

Theano 와 Caffe 실습

  • 1. Theano & Caffe 실습 김정주
  • 2. 들어가며... • 본격적인 사용법 익히기는 각 라이브러리의 Tutorial에서 진 행될 것이기에, • 여기에서는 알아두면 좋은 기타등등을 설명하도록 하겠습니 다. • 윈도우에서 설치는 다루지 않습니다. 죄송합니다.
  • 3. GPU의 발전 • 최초의 그래픽 칩은 정해진 방식의 그리기만 가능했으나, • 점점 다양한 그리기 옵션 지정이 가능해짐. • 이후 아주 기본적인 연산과 참조 기능이 들어감 • 리얼타임 그래픽스을 위한 쉐이더(Shader) 언어의 시작. • GPU(Graphics Processing Unit)으로 불리기 시작 • 게임과 실시간 그래픽 어플리케이션의 증가로 인해 급격한 성장
  • 5. GPU의 특성 • 리얼타임 그래픽스는 적당히 좋게, 그러나 빠르게가 중요 • 극히 많은 코어수로 높은 동시성 구현 가능 • 그러나 구조가 단순하고, GPU 메모리 크기 제약으로 복잡한 코드는 불가 • 조건문을 사용하면 매우 느려짐 • GPU <-> CPU 데이터 교환이 느리다
  • 6. CUDA와 GPU프로그래밍 • GPU가 점점 고급화 되며 General Computing에 사용 됨 • CUDA는 C수준의 복잡한 코드를 단순한 GPU에서 실행 가 능하게 해주는 플랫폼 • 그러나 디버깅이 어렵고, 특성을 제대로 살리지 못하면 CPU 보다 느림
  • 7. Theano와 Caffe는? • 비전문가는 GPU를 활용한 연산/분석 코드 작성이 힘듦 • Theano와 Caffe는 이것을 도와주는 라이브러리 • Theano • 다차원 배열을 사용한 수학 식을 정의, 최적화, 풀이하는 Python 라이브러리 • Caffe • 표현력, 속도, 모듈화 지원을 고려한 딥 러닝 프레임워크
  • 8. GPU 활용은 천천히 • 공부는 CPU Only 모드로 하다가, • Caffe의 경우 CUDA 설치 필수 - 헤더/라이브러리 사용 • 최적화가 필요하면 GPU를 사용하자. • CUDA - CUDA SDK와 드라이버가 설치되면 GPU 사용 • cuDNN - 설치되면 더 빠름 (옵션)
  • 9. cuDNN • NVIDIA의 Deep Neural Network 라이브러리 • CUDA를 사용하지만 함께 배포되지 않음 • https://developer.nvidia.com/cuDNN 에서 등록 후 인증이 되면 다운로드 가능 • cuDNN이 설치되어 있으면 더 좋은 퍼포먼스 - 필수 아님
  • 10. BLAS, LAPACK, ATLAS • CPU를 사용하는 라이브러리 들 • BLAS - 선형대수 계산을 위한 low-level 루틴 표준 규약 • LAPACK - 병렬처리 가능한 고급 선형대수 라이브러리 (BLAS 사용) • ATLAS - 플랫폼 독립적인 BLAS 구현체 (일부 LAPACK 연 산 포함) • OS X에서는 Accelerated framework안에 내장
  • 11. BLAS, LAPACK, ATLAS 버전 확 인 >>> import numpy as np >>> np.__config__.show() lapack_opt_info: extra_link_args = ['-Wl,-framework', '-Wl,Accelerate'] extra_compile_args = ['-msse3', '-DAPPLE_ACCELERATE_SGEMV_PATCH'] define_macros = [('NO_ATLAS_INFO', 3)] openblas_lapack_info: NOT AVAILABLE atlas_3_10_blas_threads_info: NOT AVAILABLE atlas_threads_info: NOT AVAILABLE atlas_3_10_threads_info: NOT AVAILABLE atlas_blas_info: NOT AVAILABLE atlas_3_10_blas_info: NOT AVAILABLE atlas_blas_threads_info: NOT AVAILABLE openblas_info: NOT AVAILABLE blas_mkl_info: NOT AVAILABLE blas_opt_info: extra_link_args = ['-Wl,-framework', '-Wl,Accelerate'] extra_compile_args = ['-msse3', '-DAPPLE_ACCELERATE_SGEMV_PATCH', '-I/System/Library/Frameworks/vecLib.framework/Headers'] define_macros = [('NO_ATLAS_INFO', 3)] atlas_info: NOT AVAILABLE atlas_3_10_info: NOT AVAILABLE lapack_mkl_info: NOT AVAILABLE mkl_info: NOT AVAILABLE
  • 12. Cuda 설치 • 최신 7버전 - https://developer.nvidia.com/cuda- downloads • Ubuntu • wget http://developer.download.nvidia.com/compute/cuda/7_0/Prod/ local_installers/rpmdeb/cuda-repo-ubuntu1404-7-0- local_7.0-28_amd64.deb • sudo dpkg -i cuda-repo-ubuntu1404-7-0-local_7.0-28_amd64.deb • sudo apt-get update && sudo apt-get install cuda • OS X - .dmg 파일
  • 13. Theano 설치 • Installing Theano - http://deeplearning.net/software/ theano/install.html#install • Ubuntu에서는 OpenBLAS 먼저 설치 필요 • sudo apt-get install libopenblas-dev • pip install Theano
  • 14. Ubuntu에 Caffe 설치 • http://yujuwon.tistory.com/entry/DeepLearning-우분투-1404에- Caffe-설치-하기 - 유주원님 - 참고 • 이슈 • Cuda는 7으로 설치할 것 • 파이썬 모듈 경로 지정 • export PYTHONPATH=caffe설치폴더/python:$PYTHONPATH • 파이썬 테스트를 위해 수정할 것 들 • https://gist.github.com/haje01/d268b745acd532849722
  • 15. OS X에 Caffe 설치 • http://installing-caffe-the-right-way.wikidot.com/start 참고 • Segmentation fault: 11 • CUDA7 이전 버전 사용 • Makefile.config의 파이썬 경로 확인 • 특히! PYTHON_LIB 확인 - 빌드에 사용된 lib과 실행 lib이 다 른 경우 • PYTHON_LIB := /usr/local/Cellar/python/2.7.9/ Frameworks/Python.framework/Versions/2.7/lib/
  • 16. OS X에 Caffe 설치 -2 • PyThreadState_Get: no current thread • 파이썬 인터프리터와 모듈이 서로 다른 파이썬 라이브러리를 사용. Boost 재설치 • brew uninstall boost-python • brew install --build-from-source --fresh -vd boost-python • Library not loaded … libopencv_core.2.4.dylib • OpenCV 재설치 • brew install -fs opencv
  • 17. 아몰랑.. Docker로 • 도커 설치 • 우분투 - http://blog.nacyot.com/articles/2014-01-27-easy- deploy-with-docker/ • OS X / Windows - Boot2Docker 사용 https://github.com/ boot2docker/boot2docker • 이미지 빌드 • docker build https://gist.githubusercontent.com/ haje01/7edb8b25f4c9a3b9c9d7/raw/ 7e9cbcbe88814cd9df5d263fd41e90cfebb853ed/Dockerfile
  • 18. AWS GPU 인스턴스 사용 • http://tleyden.github.io/blog/2014/10/25/running-caffe-on-aws-gpu- instance-via-docker/ 참고 • CUDA지원의 GPU가 설치된 로컬 머신 대신, AWS GPU 인스턴스 사용 • 필요할 때 필요한 만큼 사용 • 확장에 용이 • 비싸지만( 일주일 13만원 정도(g2.2xlarge, 버지니아 기준) ), 필요할 때만 켜서 사 용하면 괜찮을 듯..
  • 19. Theano와 Caffe 비교 • What about Caffe? - http://fastml.com/torch-vs-theano/ • “Caffe has a pretty different target. More mass market, for people who want to use deep learning for applications. Torch and Theano are more tailored towards people who want to use it for research on DL itself.” • Best framework for Deep Neural Nets? - https://www.reddit.com/comments/2c9x0s • “Theano is awesome. If you want a framework that's 'open-ended in terms of network architecture and transfer functions', Theano is what you're looking for. … It's definitely a different way of thinking, because you have to specify your model symbolically (i.e. write down the equations like you would in a paper, essentially). But once you are in that mindset it's pretty easy to write Theano code. The effort you invest in learning this really pays off.”
  • 20. Protocol Buffers • Google이 만든 메시지 제네레이터 • https://github.com/google/protobuf • 스키마를 통해 메시지의 형식을 정의하면 그 메시지 타입에 대한 읽기/쓰기 코드가 자동생성 • C/C++, Java, Python, Objective-C 등 다양한 언어를 제공 • Caffe의 모든 메시지는 protobuf 형식으로 정의 • https://github.com/BVLC/caffe/blob/ 85bb397acfd383a676c125c75d877642d6b39ff6/src/caffe/proto/caffe.proto
  • 21. pycaffe 문서가 별로 없다.. • 코드를 읽자! 가장 중요한 두 파일: • caffe/python/caffe/_caffe.cpp: • Blob, Layer, Net, Solver 클래스 익스포트 • caffe/python/caffe/pycaffe.py • Net 클래스에 추가 메소드
  • 22. 참고 링크 • http://developer.download.nvidia.com/compute/cuda/7_0/Prod/doc/ CUDA_Getting_Started_Linux.pdf • http://installing-caffe-the-right-way.wikidot.com/start • https://haduonght.wordpress.com/2015/02/21/install-caffe-on-mac-os-x-10-10/ • https://github.com/Homebrew/homebrew-science/issues/2209 • http://blog.nacyot.com/articles/2014-01-27-easy-deploy-with-docker/ • https://github.com/tleyden/docker/tree/master/caffe • http://vision.stanford.edu/teaching/cs231n/slides/caffe_tutorial.pdf • http://fastml.com/torch-vs-theano/ • https://www.reddit.com/comments/2c9x0s