전에는 안뜬거 같은데...

DeX를 한번 쓰고 나서 그런가? PC에 사진 빼낼게 있어서 연결했더니 이런 알림이 뜨네?

 

'개소리 왈왈 > 모바일 생활' 카테고리의 다른 글

포고플 충전식 분해  (0) 2021.05.01
usim 도착! 하지만!!  (0) 2021.04.17
pet 보호필름 2  (0) 2021.02.28
pet 보호필름  (0) 2021.02.27
안드10 절전 모드 정책  (0) 2021.02.26
Posted by 구차니

봄이라서 그런가

미친듯이 피곤해서 지하철에서 기절하듯 잠들었다.

 

오늘부터 지하철 시간이 바뀌었는지 급행 시간이 조금 달라졌네

'개소리 왈왈 > 직딩의 비애' 카테고리의 다른 글

야 너두 6천?  (2) 2021.04.01
arm 서버  (0) 2021.03.15
주말은 쉬는걸 다행으려 여겨야 하나 ㅠㅠ  (0) 2021.03.06
2일 연속 야근  (0) 2021.03.05
spi 어우..  (0) 2021.03.03
Posted by 구차니
embeded/FPGA - ALTERA2021. 3. 9. 20:25

cyclone iv 에 모든 버전 사용가능.

de0 nano 간만에 살랴봐야하나

 

[링크 : http://github.com/maikmerten/riscv-tomthumb]

[링크 : http://github.com/open-design/riscv-soc-cores]

[링크 : http://github.com/SpinalHDL/VexRiscv]

 

 

'embeded > FPGA - ALTERA' 카테고리의 다른 글

oneAPI Quartus pro 필요?  (0) 2021.04.06
cyclone V openCL?  (0) 2021.03.26
quartus II 9.0이 아니야? 4.2 설치!  (0) 2020.06.23
큰 맘 먹고 질렀으나..  (0) 2020.06.22
APEX FPGA quartus 지원 버전  (0) 2020.06.22
Posted by 구차니

서울대 컴공과 미달이었다는데

15년 전이면 최소 경력 10년 되는 고급 개발자인데

그걸 이제와서 하소연 하는건

 

1. 개발자를 정말 1개월 언어 공부하면 끝나는 업종으로 알고 있었던가

2. 정상적으로 키울 생각 않고 있다가 기업들이 사람 부족해요 하니 핑계로 15년전을 대거나

 

아니면 둘 다거나 정도밖에 안되는 사고력인 듯.

 

[링크 : https://news.v.daum.net/v/20210309065004097]

'개소리 왈왈 > 정치관련 신세한탄' 카테고리의 다른 글

KF-X 8조 8천  (2) 2021.04.11
서울 시민은 아니지만..  (2) 2021.04.07
의사 면허 취소 반대?  (0) 2021.02.20
미국 정전 반도체 타격  (2) 2021.02.17
트럼프의 나비효과?  (0) 2021.01.10
Posted by 구차니
Linux2021. 3. 8. 17:48

어짜피 스크립트 실행하는 느낌적인 느낌이라

; 던 &&던 상관없긴 하지만 조건식에 의해서 뒤에것이 실행될게 아니라면 ;가 편할 듯.

 

$ watch -n 1 'cmd1; cmd2'

$ watch -n 1 'cmd1 && cmd2'

 

[링크 : https://askubuntu.com/questions/595927/using-watch-run-2-commands]

'Linux' 카테고리의 다른 글

리눅스 커널 로그레벨 변경  (0) 2021.06.08
dm cache  (0) 2021.04.24
원격실행된 python/opencv 키 입력  (0) 2021.02.26
'xterm': unknown terminal type.  (0) 2021.02.25
tar with pigz  (0) 2021.02.23
Posted by 구차니

애 둘 데리고 다니는게 쉽진 않지만

그나마 나이가 좀 먹어서 인지

그럭저럭 끌고 다닐만큼은 되네 ㅋㅋ

'개소리 왈왈 > 육아관련 주저리' 카테고리의 다른 글

첫 째 이빨 흔들림  (0) 2021.03.13
비 조금, 미세먼지 뚝  (0) 2021.03.12
눈이 온다  (2) 2021.03.01
재활용 데이  (0) 2021.02.15
시간가는지 모르겠다.  (0) 2021.02.14
Posted by 구차니

아우 일 바빠 ㅠㅠ

'개소리 왈왈 > 직딩의 비애' 카테고리의 다른 글

arm 서버  (0) 2021.03.15
지하철 타고 오다가 쿨쿨  (0) 2021.03.10
2일 연속 야근  (0) 2021.03.05
spi 어우..  (0) 2021.03.03
결정세액 0원이 좋은게 아니었나?  (0) 2021.02.26
Posted by 구차니

으으 시르다 ㅠㅠ

'개소리 왈왈 > 직딩의 비애' 카테고리의 다른 글

지하철 타고 오다가 쿨쿨  (0) 2021.03.10
주말은 쉬는걸 다행으려 여겨야 하나 ㅠㅠ  (0) 2021.03.06
spi 어우..  (0) 2021.03.03
결정세액 0원이 좋은게 아니었나?  (0) 2021.02.26
계단 오르기  (0) 2021.02.21
Posted by 구차니

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'.

 

Posted by 구차니

아놔.. 라즈베리용 빌드를 썼더니.. -_-

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 형이라는게 차이가 있고

출력이 왜이렇게 여러가지가 존재하는거지?

 

[링크 : https://github.com/.../mobilenet_quant_v1_224.tflite]

Posted by 구차니