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

Serving 용 export

~8 min · serialize

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

save 는 나를 위한 것, export 는 세상을 위한 것

여태 다룬 건 전부 save내가 계속 학습할 수 있게 모델을 round-trip 하는 거였어. export 는 반대 방향이야: serving 시스템이 돌릴 수 있는 inference 전용 결과물을 만들어. 그 시스템은 Keras 가 뭔지 들어본 적도 없을 수 있어. model.export() 한 번에 format= 인자를 주는데, 그 인자 하나가 어느 배포 세계를 겨냥할지 정해.

한 호출, 네 갈래 목적지

각 포맷이 서로 다른 배포 질문에 답해. tf_saved_model 은 TensorFlow 생태계의 native serving 포맷 — TF Serving 이나 TF.js 에 넣어. onnx 는 vendor 중립 교환 표준이야. inference runtime (Triton, ONNX Runtime, 하드웨어 vendor stack) 이 ONNX 를 기대할 때 이걸로 export 해. openvino 는 CPU 위주 배포용 Intel 최적화 inference engine 을 겨냥해. litert (예전 TFLite 라는 이름) 은 mobile / edge 타깃 — 작고, quantize 가능하고, 폰이랑 마이크로컨트롤러에서 돌게 만들어졌어.

네 string 을 외우라는 게 아니야. 핵심은 — 네가 학습한 모델은 single source of truth 고, export 는 그걸 배포에 필요한 runtime 위로 투영하는 것뿐이라는 거.

Code

네 가지 serving 포맷으로 export·python
# TF SavedModel (for TF Serving)
model.export("model_dir", format="tf_saved_model")

# ONNX (cross-platform inference)
model.export("model.onnx", format="onnx")

# OpenVINO (Intel optimized inference)
model.export("model_ov", format="openvino")

# TFLite (mobile/edge)
model.export("model.tflite", format="litert")

External links

Exercise

MNIST 학습. 둘 다: model.save('mnist.keras') + model.export('mnist_export'). disk 크기 비교. 그다음 export 를 TFLite 로 변환하고 .tflite 크기 검사 — 훨씬 작아야.

Progress

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

댓글 0

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

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