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 |
Tags
- DataAccess
- 덴드로그램
- 최댓값
- matplotlib
- hierarchical_clustering
- IN
- append()
- pandas
- len()
- Dictionary
- string
- sklearn
- 반복문
- wcss
- data
- elbow method
- DataFrame
- list
- function
- nan
- analizer
- 분류 결과표
- del
- numpy
- count()
- Machine Learning
- insert()
- Python
- 최솟값
- dendrogram
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 |