일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- 블록체인
- cv2
- deeplearning
- img
- Training
- 유가 급등
- dtype
- TFRecord
- error
- numpy
- 비트코인
- opencv
- loss
- Python
- DataSet
- 세계대전
- 딥러닝
- qtdesigner
- terminal
- 세계사
- itksnap
- Inference
- keras
- 퍼셉트론
- 브렉시트
- Perceptron
- 유로화
- TensorFlow
- pyqt
- TF
Archives
- Today
- Total
활연개랑
[ERROR 해결] Input 0 of layer "conv2d" is incompatible with the layer: expected min_ndim=4, found ndim=2. Full shape received 본문
Python
[ERROR 해결] Input 0 of layer "conv2d" is incompatible with the layer: expected min_ndim=4, found ndim=2. Full shape received
승해tmdhey 2022. 5. 9. 09:18반응형
Input 0 of layer "conv2d" is incompatible with the layer: expected min_ndim=4, found ndim=2. Full shape received:
inference 를 하는 과정에서 predict 값을 구하기 위해 model에 x값을 넣어주었을 때 다음과 같은 오류가 발생하였습니다.
x의 shape은 (300,400)이었으나, model로 들어갈 때 (batch, width,height, channel)형태로 들어가 주어야 하기 때문입니다.
t_x = t_x.reshape(1, t_x.shape[0], t_x.shape[1], 1)
pred = model(t_x)
위와 같이 reshape을 해주면 잘 들어갑니다!