일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- 세계사
- Training
- 브렉시트
- keras
- qtdesigner
- 퍼셉트론
- 블록체인
- itksnap
- Perceptron
- DataSet
- TF
- Inference
- TensorFlow
- deeplearning
- dtype
- 비트코인
- numpy
- 딥러닝
- pyqt
- cv2
- 유로화
- TFRecord
- terminal
- 유가 급등
- loss
- Python
- opencv
- 세계대전
- error
- img
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오류를 해결할 수 있습니다.