| from keras.applications import VGG16 # VGG16 베이스 모델 from keras.applications.vgg16 import preprocess_input # VGG 전용 전처리 함수 # 데이터셋에 VGG16 전용 전처리 (preprocess_input) 적용하기 training_set = training_set.map(lambda x, y: (preprocess_input(x), y)) test_set = test_set.map(lambda x, y: (preprocess_input(x), y)) # VGG16 베이스 모델 로드하기 (ImageNet 가중치 사용, 상단 Dense 레이어 제외) vgg = VGG16(weights='imagenet', include_top=False, input_shape=IMG_SIZE+(3,)) vgg.trainable = False # VGG16의 가중치를 고정 (전이 학습) vgg.summary( ) |