본문 바로가기
Data Science/Deep Learning

Keras Layer 입력/출력 크기 구하는 법

by Queen2 2022. 11. 16.
728x90
반응형

특정 레이어의 입력/출력 크기를 알고 싶다면

  • layer.get_input_at(node_index)
  • layer.get_output_at(node_index)
  • layer.get_input_shape_at(node_index)
  • layer.get_output_shape_at(node_index)

 

예시)

model = VGG16(weights='imagenet', include_top=False)
input_shape = model.layers[-4].get_input_shape_at(0)

VGG16 모델을 사용하려 할 때, 끝에서 4번째 층의 입력 shape 을 알고 싶을 때 

 

 

 

Source:

https://www.kaggle.com/code/vincee/intel-image-classification-cnn-keras/notebook

https://keras.io/ko/layers/about-keras-layers/

728x90
반응형

댓글