The Beautiful Future

caffe console command train graph 본문

DNN

caffe console command train graph

Small Octopus 2016. 10. 24. 23:55

Command Line : http://caffe.berkeleyvision.org/tutorial/interfaces.html

** 카페 학습 시작 

caffe train --solver=./solver.prototxt


** GPU 설정

caffe train --solver=./solver.prototxt --gpu 0 


** 학습을 재개 할 때 

caffe train --solver=./solver.prototxt --snapshot=./iter_5000.solverstate


** 파인튠

caffe train --solver=./solver.prototxt --weights=./caffenet.caffemodel

조금더 자세한 내용은 examples/finetuning_on_flickr_style에 있다...

**  실행 시간

- cpu for 10 iter

caffe time -model train_test.prototxt --iteration 10

-gpu for default 50 iter

caffe time -model train_test.prototxt --gpu 0

- given weight

caffe time --model=train_test.prototxt --weight=./caffe.caffemodel --gpu 0


** 성능 테스트

caffe test --model=train_test.prototxt --weights=caffenet.caffemodel --gpu 0 --iteration 100

테스트 페이즈에있는 구조만 가지고 실행한다. 배치마다 스코어가 전달되며 최종적으로 평균이 전달된다.


** GPU 진단 , GPU Diagnostics

caffe device_query -gpu 0


** GPU 메모리, 온도, 점유율 확인

sudo nvidia-smi -l second


** 로그저장법

caffe train --solver=./solver.prototxt --gpu 0 1> log.txt 2>&1


** 그래프 그리는 법

python caffe\tools\extra\parse_log.py /src_log.txt ./

그러면 src_log.txt.train과 src_log.txt.test 파일 csv파일이 만들어진다.


%matplotlib inline

import pandas as pd

import matplotlib.pyplot as plt

train_log = pd.read_csv("./log.txt.train")

test_log = pd.read_csv("./log.txt.test")

_, ax1 = plt.subplots(figsize=(15, 10))

ax2 = ax1.twinx()

ax1.plot(train_log["NumIters"], train_log["loss-pitch"], alpha=0.4)

ax1.plot(test_log["NumIters"], test_log["loss-roll"], 'g')

ax1.plot(test_log["NumIters"], test_log["loss-yaw"], 'r')

ax1.set_xlabel('iteration')

ax1.set_ylabel('train loss')

'DNN' 카테고리의 다른 글

caffe solver  (0) 2016.10.26
[TensorFlow] TensorFlow Mechanics 101  (0) 2016.10.26
tensor flow add op  (0) 2016.10.05
우분투 팁  (0) 2016.09.30
Age gender tal example  (0) 2016.04.27
Comments