C.W.K.
Stream
Lesson 03 of 08 · published

TensorFlow Backend

~8 min · backend

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

default, 그리고 배포의 왕인 이유

TensorFlow 는 Keras 3 의 *default backend* (TF 2.16.1+). 아무것도 안 박으면 이게 켜져. 진짜 강점은 학습 속도가 아니라 *deployment 인프라* — 학습된 model 에서 출시 제품까지 가는 길이 가장 넓고 성숙해.

  • 대규모 학습 TPU 지원 최강
  • TF Serving 으로 production 급 HTTP/gRPC 서빙
  • TFLite 로 mobile / edge
  • TensorFlow.js 로 browser inference
  • 어느 backend 보다 두꺼운 문서·커뮤니티

한 model, 네 배포 타깃

학습 loop 보다 *목적지* 가 중요할 때 TF backend 를 꺼내 — production 파이프라인, mobile / edge 출시, 이미 TF 인프라로 통일한 팀. payoff 는 model.export(): TF Serving 이 바로 먹는 SavedModel 을 뱉고, 재빌드 없이 TFLite 로도 변환돼 (아래 Code block). TF 1.x graph mode 시절과 달리 전부 eager 라 print() 하나 박으면 디버깅 그냥 보여.

Code

TF 로 학습 후 TF Serving 용 SavedModel export·python
os.environ["KERAS_BACKEND"] = "tensorflow"
import keras

model = keras.Sequential([...])
model.compile(optimizer="adam", loss="sparse_categorical_crossentropy")
model.fit(x_train, y_train)

# Export for TF Serving
model.export("serving_model", format="tf_saved_model")

External links

Exercise

KERAS_BACKEND=tensorflow 로 tiny MNIST 모델 만들고 한 epoch 학습. model.export('mymodel') 호출하고 TF SavedModel 구조 (assets/, variables/, saved_model.pb) 확인.

Progress

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

댓글 0

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

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