Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | |||||
| 3 | 4 | 5 | 6 | 7 | 8 | 9 |
| 10 | 11 | 12 | 13 | 14 | 15 | 16 |
| 17 | 18 | 19 | 20 | 21 | 22 | 23 |
| 24 | 25 | 26 | 27 | 28 | 29 | 30 |
| 31 |
Tags
- nan
- 최댓값
- 반복문
- DataAccess
- pandas
- matplotlib
- data
- del
- 최솟값
- function
- elbow method
- Machine Learning
- 분류 결과표
- analizer
- append()
- list
- hierarchical_clustering
- sklearn
- len()
- count()
- 덴드로그램
- wcss
- dendrogram
- numpy
- Python
- string
- IN
- DataFrame
- insert()
- Dictionary
Archives
- Today
- Total
개발공부
에포크 시마다 가장 좋은 모델을 저장하는 ModelCheckpoint 본문
예제
# 파이썬으로 디렉토리 만드는 코드 작성
if not os.path.exists('디렉토리 경로') :
os.makedirs('디렉토리 경로')
from tensorflow.keras.callbacks import ModelCheckpoint
# monitor = 어떤 것을 지표로 삼을지
# save_best_only :가장 좋은 모델 저장
cp = ModelCheckpoint('저장할경로/파일명.h5', monitor = 'val_accuracy', save_best_only = True, verbose = 1)
model.fit(X_train, y_train, epochs = 50, validation_data = (X_val,y_val), callbacks = [cp])
'Python > Deep Learning' 카테고리의 다른 글
| 에포크 시마다 기록(로그)을 남길 수 있는 CSVLogger (0) | 2022.06.16 |
|---|---|
| Fine Tuning을 하기 위한 코드와 설명 (0) | 2022.06.16 |
| Transfer Learning을 이용한 이미지 분류 실습 (0) | 2022.06.16 |
| Transfer Learning 개념 (0) | 2022.06.16 |
| 파일을 training과 test 디렉토리로 나눠서 저장하는 방법 (0) | 2022.06.15 |