IT 지식 창고

(keras) model과 weight 종속성

casim 2020. 9. 22. 18:06

2020.09.22 작성

 

1. model을 load할 때, tensorflow 2.3에서 만든 model이 2.2이 호환되지 않음. 그 반대는 가능함.

 

2. model == weight라고 할 수 있음

  • model의 레이어 수와 weight의 레이어수가 같아야함.

model의 레이어 수가 더 적을 경우 아래와 같은 에러가 남.

You are trying to load a weight file containing 23 layers into a model with 19 layers.
#23개의 레이어가 포함되어있는 weight 파일을 19개의 레이어로 이루어진 model에 로드하려고 합니다.
  • model의 Input shape및 channel과 weight가 같아야함.

model의 채널이 다를 경우 아래와 같은 에러가 남.

Shapes (3, 3, 3, 32) and (32, 1, 3, 3) are incompatible
#input shape이 (256, 256, 3) model에 (256, 256, 1)로 만들어진 weight를 load할 경우 발생