| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 | 31 |
Tags
- TF
- itksnap
- DataSet
- pyqt
- terminal
- opencv
- 딥러닝
- 세계사
- 세계대전
- Perceptron
- dtype
- deeplearning
- 유가 급등
- 블록체인
- 브렉시트
- 비트코인
- keras
- img
- numpy
- loss
- Training
- error
- Python
- qtdesigner
- 유로화
- 퍼셉트론
- Inference
- TensorFlow
- cv2
- TFRecord
Archives
- Today
- Total
활연개랑
[tensorflow] tf.numpy_function() dim error 문제해결 본문
반응형
tf.numpy_function을 사용할 때 dim 관련 오류가 날 수 있습니다.
tf.numpy_function을 이미지에 사용할 경우 reshape이 필요하기 때문에 다음과 같이 reshape을 해주어야 합니다.
image_shape = tf.shape(image)
image = tf.numpy_function(definition(func), [image], tf.float32)
image = tf.reshape(image, image_shape)
이렇게 reshape을 해주면 dimensipn오류를 해결할 수 있습니다.