C.W.K.
Stream
Lesson 01 of 07 · published

.keras 포맷

~8 min · serialize

Level 0Keras 도제
0 XP0/97 lessons0/20 achievements
0/120 XP to next level120 XP to go0% complete

`.keras` 포맷은 weights + architecture + metadata 가 한 zip 모양 파일에 다 들어있고, 그 파일 한 개가 어느 backend 에서든 로드돼. 거기에 deploy 용 weight-only 저장, subclass layer round-trip 시키는 custom-object registration, TF SavedModel / TFLite handoff 용 `model.export()` 까지.

Keras 3 의 표준 저장 포맷. 한 zip 파일에 weights + architecture + config + metadata 다 들어있어. model.save('mymodel.keras') 한 줄. 로드는 model = keras.models.load_model('mymodel.keras').

cross-backend 안전 — TF 로 저장한 .keras 가 PyTorch 또는 JAX backend 에서도 로드 가능. weight tensor 는 backend-agnostic 한 numpy array 로 직렬화. 이게 다른 포맷들과의 결정적 차별점.

Code

# Save the complete model
model.save("my_model.keras")

# Load it back
loaded_model = keras.models.load_model("my_model.keras")

External links

Exercise

작은 model 학습. .keras 로 저장. unzip -l 로 파일 구조 검사. 다시 로드, weight 가 numpy.allclose 로 정확히 일치 확인.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.