으으 시르다 ㅠㅠ
'개소리 왈왈 > 직딩의 비애' 카테고리의 다른 글
지하철 타고 오다가 쿨쿨 (0) | 2021.03.10 |
---|---|
주말은 쉬는걸 다행으려 여겨야 하나 ㅠㅠ (0) | 2021.03.06 |
spi 어우.. (0) | 2021.03.03 |
결정세액 0원이 좋은게 아니었나? (0) | 2021.02.26 |
계단 오르기 (0) | 2021.02.21 |
으으 시르다 ㅠㅠ
지하철 타고 오다가 쿨쿨 (0) | 2021.03.10 |
---|---|
주말은 쉬는걸 다행으려 여겨야 하나 ㅠㅠ (0) | 2021.03.06 |
spi 어우.. (0) | 2021.03.03 |
결정세액 0원이 좋은게 아니었나? (0) | 2021.02.26 |
계단 오르기 (0) | 2021.02.21 |
inference_input_type과 interfence_output_type을 tf.int8로 지정해주면 양자화 해주는 듯
import tensorflow as tf
converter = tf.lite.TFLiteConverter.from_saved_model(saved_model_dir)
converter.optimizations = [tf.lite.Optimize.DEFAULT]
converter.representative_dataset = representative_dataset
converter.target_spec.supported_ops = [tf.lite.OpsSet.TFLITE_BUILTINS_INT8]
converter.inference_input_type = tf.int8 # or tf.uint8
converter.inference_output_type = tf.int8 # or tf.uint8
tflite_quant_model = converter.convert()
[링크 : https://www.tensorflow.org/lite/performance/post_training_quantization]
[링크 : https://www.tensorflow.org/lite/performance/post_training_integer_quant?hl=ko]
+
2021.03.31
import tensorflow as tf
import numpy as np
saved_model_dir="./"
#def representative_dataset():
# for data in tf.data.Dataset.from_tensor_slices((images)).batch(1).take(100):
# yield [data.astype(tf.float32)]
def representative_dataset():
for _ in range(100):
data = np.random.rand(1, 244, 244, 3)
yield [data.astype(np.float32)]
converter = tf.lite.TFLiteConverter.from_saved_model(saved_model_dir)
converter.optimizations = [tf.lite.Optimize.DEFAULT]
converter.representative_dataset = representative_dataset
converter.target_spec.supported_ops = [tf.lite.OpsSet.TFLITE_BUILTINS_INT8]
converter.inference_input_type = tf.int8 # or tf.uint8
converter.inference_output_type = tf.int8 # or tf.uint8
tflite_quant_model = converter.convert()
open("saved_model.tflite", "wb").write(tflite_quant_model)
[링크 : https://bugloss-chestnut.tistory.com/entry/Tensorflow-tflite를-Quantization양자화하기python]
도대체 왜 크기가 안 맞는다고 나올까..
다시보니.. 모델은 320x320 인데 244x244로 되어서 안 맞아서 그런듯.
Traceback (most recent call last):
File "conv.sh", line 21, in <module>
tflite_quant_model = converter.convert()
File "/home/minimonk/.local/lib/python3.8/site-packages/tensorflow/lite/python/lite.py", line 742, in convert
result = self._calibrate_quantize_model(result, **flags)
File "/home/minimonk/.local/lib/python3.8/site-packages/tensorflow/lite/python/lite.py", line 459, in _calibrate_quantize_model
return calibrate_quantize.calibrate_and_quantize(
File "/home/minimonk/.local/lib/python3.8/site-packages/tensorflow/lite/python/optimize/calibrator.py", line 97, in calibrate_and_quantize
self._calibrator.Prepare([list(s.shape) for s in sample])
RuntimeError: tensorflow/lite/kernels/reshape.cc:69 num_input_elements != num_output_elements (5136 != 7668)Node number 93 (RESHAPE) failed to prepare.
(1,320,320,3) 으로 바꾸니 5136에서 8136 으로 바뀌었다.
저 수식 어떻게 되어먹은거야?
RuntimeError: tensorflow/lite/kernels/reshape.cc:69 num_input_elements != num_output_elements (8136 != 7668)Node number 93 (RESHAPE) failed to prepare.
아무튼.. pipeline.config를 보니 300x300 이라 넘어는 가는데..
이건 또 무슨 에러냐..
RuntimeError: Quantization not yet supported for op: 'CUSTOM'. |
tensorflow quantization (0) | 2021.04.02 |
---|---|
tensorflow lite (0) | 2021.04.01 |
tensorflow/lite/core/subgraph.cc BytesRequired number of elements overflowed. part 2? (0) | 2021.03.04 |
tensorflow/lite/core/subgraph.cc BytesRequired number of elements overflowed. (0) | 2021.03.02 |
ssd model convert for tflite (0) | 2021.02.26 |
아놔.. 라즈베리용 빌드를 썼더니.. -_-
libtensorflowlite.a 가 neon-vfp4 용으로 빌드되어서 정상작동하지 않아 저런 에러가 난건가?
확신은 못하겠지만 아무튼.. 라이브러리도, label_image도 모두 다시 빌드하니 문제없이 돌아는 간다.
---
혹시나 해서 입력 사이즈를
label_image 소스에서 224*224 로 되어있는 부분을 320*320으로 바꾸어 줘도 동일하게 에러가 발생한다 -_-
netron 으로 모델을 확인해보는데 정보가 많이 상이하긴 하다.
파일명 처럼 quantization 되어 있어서 0~1로 uint8로 받고 출력은 uint8[1,1001]
변환한 녀석은 float32[1,300,300,3] 차원은 동일한데 float32 형이라는게 차이가 있고
출력이 왜이렇게 여러가지가 존재하는거지?
tensorflow lite (0) | 2021.04.01 |
---|---|
tensorflow 양자화 (0) | 2021.03.04 |
tensorflow/lite/core/subgraph.cc BytesRequired number of elements overflowed. (0) | 2021.03.02 |
ssd model convert for tflite (0) | 2021.02.26 |
tensorflow 용어 정의 (0) | 2021.02.25 |
별거 아닌 것 같은데
이렇게 까지 안된다고 다른 분들도 절래절래 중 ㅠㅠ
주말은 쉬는걸 다행으려 여겨야 하나 ㅠㅠ (0) | 2021.03.06 |
---|---|
2일 연속 야근 (0) | 2021.03.05 |
결정세액 0원이 좋은게 아니었나? (0) | 2021.02.26 |
계단 오르기 (0) | 2021.02.21 |
정신없어!! (2) | 2021.02.16 |
모델은 320x320이고
label_image 예제는 224x224 로 차이가 있긴한데
입력 이미지 크기도 영향을 받으려나?
[링크 : https://stackoverflow.com/questions/63500096]
tensorflow 양자화 (0) | 2021.03.04 |
---|---|
tensorflow/lite/core/subgraph.cc BytesRequired number of elements overflowed. part 2? (0) | 2021.03.04 |
ssd model convert for tflite (0) | 2021.02.26 |
tensorflow 용어 정의 (0) | 2021.02.25 |
tflite convert (0) | 2021.02.24 |
아 내일 출근... 아놔 ㅠㅠ
그나저나 3월에 눈이라니
조치원에서야 5월에 눈 본적이 있긴 하지만
전국적으로 3월에 눈 온건 드문 것 같네?
비 조금, 미세먼지 뚝 (0) | 2021.03.12 |
---|---|
애들과 산책 (0) | 2021.03.07 |
재활용 데이 (0) | 2021.02.15 |
시간가는지 모르겠다. (0) | 2021.02.14 |
주말.. 쉬긴 개뿔 (0) | 2021.02.13 |
옆이 뜬다 ㅠㅠ
PET 특징인지 아니면 보관상의 문제가 된 걸 받아서 그런건지 모르겠다.
아무튼 커버에서 빼서 좌우 위 눌러 조금은 u자로 되도록 손을 보고 붙여봐야 할 것 같네
유리보다는 약해서 확실히 열쇠에 긁히고
지문은 좀 안남지만 전화하고 하면 땀이랑 유분은 지워지지도 않네 ㅠㅠ
usim 도착! 하지만!! (0) | 2021.04.17 |
---|---|
삼성 dex 앱? (0) | 2021.03.11 |
pet 보호필름 (0) | 2021.02.27 |
안드10 절전 모드 정책 (0) | 2021.02.26 |
노트9 dex 첫 경험 (0) | 2021.02.24 |
노트9 인데 엣지 디스플레이 부분이 곡률이 안 맞나 자꾸 뜬다
곡선 부분때문에 붙이기도 쉽지않네..
언제나 그렇지만(!) 처음에 붙일때는 하나 날리고 붙이는 것이긴 한데 ㅠㅠ
+
붙이고 방심하고 돌아오면 꽤나 많이 들린다는게 문제네
삼성 dex 앱? (0) | 2021.03.11 |
---|---|
pet 보호필름 2 (0) | 2021.02.28 |
안드10 절전 모드 정책 (0) | 2021.02.26 |
노트9 dex 첫 경험 (0) | 2021.02.24 |
gmail 앱 동기화 안될 경우 (0) | 2021.02.24 |
절전이 타이트 해졌는지 조금 인터넷 하고 포고돌아가면 종료되어있고
그냥 화면만 꺼놓고 포고플 해놨는대 죽어서 찾아보니
안드10부터 발생한 문제(?) 인 듯
[링크 : http://www.inven.co.kr/board/pokemongo/4989/3179]
그나저나 자사앱 smart things는 소리소문 없이 등록해두다니 ㅋㅋㅋㅋ
아래 방법으로도 해결은 안된다. multistar 써봐야하나
pet 보호필름 2 (0) | 2021.02.28 |
---|---|
pet 보호필름 (0) | 2021.02.27 |
노트9 dex 첫 경험 (0) | 2021.02.24 |
gmail 앱 동기화 안될 경우 (0) | 2021.02.24 |
카카오톡 대화내용 옮기기 (0) | 2021.02.07 |
공제가족 수에 따라 연봉이 일정 금액 이하일 경우 결정세액 2원,
기납부세액 전액을 환급 받고 다른 소득공제 및 세액공제 자료를 확보할 필요가 없다는데
아무튼 예전보다 돌려받는게 줄어서 고민을 해봤더니
아마도.. 작년에 반은 쉬는 바람에 급여가 줄어서 그런것 같고
기납부세액 전액을 돌려받을뿐(인적공제만 받음) 나머지는 돌려받을수 있는게 없어서 그런 듯 ㅠㅠ