nnstreamer-preprocessor / nnstreamer

4 stars 0 forks source link

nnstreamer model 파트 #5

Open yesolyun opened 4 years ago

yesolyun commented 4 years ago

목표: 다음주까지 nnstreamer(on ubuntu)의 모델 부분에서 학습해서 score가 나올 수 있게 만들어본다

세부 사항: -nnstreamer의 tensorflow 부분을 살펴보고 올려보기 -tensorflow-lite(재욱님 말씀으로 tensorflowlite는 후처리 과정)이 들어가는 과정살펴보기 -기존에 작업했었던 squeezenet을 nnstreamer위에서 돌릴 수 있게 tensorflow를 포팅하기

jwkanggist commented 4 years ago

네 좋습니다

DownyBehind commented 4 years ago

모델 학습용 환경 구축은 유라님이 진행하시는건가요?

yura1h commented 4 years ago

모델 학습용 환경 구축은 유라님이 진행하시는건가요?

넵!

yesolyun commented 4 years ago

네 좋습니다

  • tf 폴터를 따로 만드셔서 코드 커밋하시는게 좋을꺼 같아요
  • tflite는 이단 놔두시고 nnstreamer 연결하는 부분만 집중해서 고고!
  • 결과물은 nnstreamer 연결된 squeezenet tf train 코드로 이해하면 될까요 ?

네 우선 이번주는 nnstreamer 연결 부분만 집중해보겠습니다! 그리고 결과물은 train 코드가 맞습니다

yesolyun commented 4 years ago

3/5까지 nnstreamer-example 예제를 실행하려 했으나 tensorflow-lite 예제가 빌드가 안되었는데 유라님이 tensorflow에서는 성공하셨다고 한다. 오늘 내일 작업해서 tensorflow 예제 기반으로 squeezenet을 넣어보도록한다.

jwkanggist commented 4 years ago

@yesolyun 이미 squeezenet tflite 이 빌드 된것이 있을텐데요 그 모델 다운로드 해서 tf 로 불러서 연결해서 전체 시스템이 동작하는지 부터 확인하시는건 어떤가요 ?

yesolyun commented 4 years ago

지난번에 만들었던 pb파일이 파싱에러가 있었어서 이번주는 mobilenet_v3 모델을 만들기 위해 시도를 해봤으나 .pb 파일과 .tflite 모델 둘다 에러가 발생하는 부분은 해결을 아직 못했습니다

  1. .pb파일과 같은 경우는 다양한 에러들이 존재했는데 가장 크게 두가지는 첫번째는 tensorflow objectdetection github의 pb파일이 조금 outdated한 문제가 있어서 이것을 200114 버전과 사용자들이 수정해서 올린 버전들을 이용해봤으나 문제가 완전히 해결되지는 않았습니다. 두번째 문제는 이제 graph를 불러와야하는데 tf.graph_util.import_graph_def 줄에서 tensorflow.python.framework.errors_impl.NotFoundError: Op type not registered 'TFLite_Detection_PostProcess' in binary running on yesolcom. 가 뜨고 이를 해결하려면 import tensorflow.contrib.decent_q 를 먼저 선언하라 했으나 tensorflow.contrib까지는 불러올 수 있는데 decent_q와 같은 경우는 없다고 했습니다. 문제를 이 뒤론 더이상 어떻게 해결할지 모르겠어서 그간 고수해온 .pb를 잠시 접고 .tflite 작업을 시작했습니다.

  2. tflite는 아직 초기 단계인데 현재 나타나는 에러는 ERROR: Op builtin_code out of range: 117. Are you using old TFLite binary with newer model?라서 Tflite를 다시 설치해보려했지만 여전히 같은 메세지가 떠서 아직 수확은 없는 상태입니다. https://stackoverflow.com/questions/59997880/tflite-mobilenet-v3-are-you-using-an-older-tflite-binary-with-a-new-model 정확히 같은 메세지가 있는데 이것 외에는 찾지 못해서 아직 헤매고 있습니다.

사실 굳이 이 작업을 하지 않아도 모델을 .pb까지 만들면 될것 같긴한데 만든 것을 불러와서 제대로 작동하는지 보는 것이 중요한 것 같아 며칠동안은 이 부분을 고민해봤습니다.

yesolyun commented 4 years ago

https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/detection_model_zoo.md

http://download.tensorflow.org/models/object_detection/ssd_mobilenet_v3_small_coco_2020_01_14.tar.gz

https://github.com/tensorflow/models/issues/7727

mobilenetv3 예제 모델, 최신 200104 업데이트 버전, 사용자들이 수정한 pb파일 세가지 찾아봤습니다