Skip to content

Android 스튜디오에서의 문제 #1129

Open

Description

@ZeroOneKim

해결하고자 하는 문제

android studio에서 모델을 넣어보려고 하였는데 메타데이터값이 없다고 하는 문제

코드 혹은 오류

tflite 파일을 넣었는데 no meta data in this model 이라고 뜹니다. 즉, 메타데이터가 없다는거 같은데 이해가 잘 안갑니다.
추가하는 방법이라며, https://www.tensorflow.org/lite/convert/metadata 라고 링크를 걸어 놨는데, 이해가 안갑니다.

환경

Android studio는 4.1 이상버전이 요구된대서 4.2로 업데이트 하였고 minimum SDK = API 27:android 8.1(OREO)
Language = Kotlin

시도해본 방법

tensorflow 공식 유튜브 검색/ 구글링 검색

Activity

  1. blackdew commented on Jul 23, 2021

    @blackdew
    Collaborator

    찾으신 링크의 아래부분에 메타데이터를 생성하는 예제코드가 잘 되어있는 것 같아요.
    https://www.tensorflow.org/lite/convert/metadata#deep_dive_into_the_image_classification_example

    이 설명의 실제 예제 파일은 다음 링크로 되어있네요.
    https://github.com/tensorflow/examples/blob/master/lite/examples/image_classification/metadata/metadata_writer_for_image_classifier.py

    이 예제 파일을 실행하는 명령은 다음이고요. :)

    python ./metadata_writer_for_image_classifier.py \
        --model_file=./model_without_metadata/mobilenet_v1_0.75_160_quantized.tflite \
        --label_file=./model_without_metadata/labels.txt \
        --export_directory=model_with_metadata
    

    이미 원하는 것을 잘 찾으셨으니 이걸 하나씩 살펴보시며, 이해해 나가시면 원하는 것을 얻을 수 있을 겁니다.
    만약, 이 문서에서 이해가지 않는 부분이 있다면, 그것이 바로 실력을 키울 수 있는 기회라고 생각하시면 되겠어요.
    방대한 지식의 세계에서 새로운 길잡이를 만난 것이죠. 다음에 가야할 또 다른 출발점이 되어줄 것입니다.

  2. added
    Android / iOS
    ML / DL
    on Jul 30, 2021
  3. progh2 commented on Jul 30, 2021

    @progh2
    Collaborator

    해결하셨나요? 정 안되시면 예시 코드를 깃허브에 올려서 테스트 가능해게 해서 소스를 올려주시면
    무엇이 문제인지 파악하는데 좀 더 참고가 될 것 같습니다. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Android / iOSML / DL

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions